Ticket #2844 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

msProjectRect return value not checked

Reported by: pramsey Owned by: pramsey
Priority: normal Milestone: 5.6 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords: projections
Cc: warmerdam

Description

Right now, in mapdraw.c and mapraster.c, when msProjectRect is called to move the draw rectangle into the source projection, the success of the operation is assumed. However, for data sources in incompatible planar projections, far from the draw rectangle, the projection operation will fail completely: no good points will be returned.

Right now the behavior is to fall back to basically make a rectangle in the source projection that covers everything (-180,-90 180 90) for latlong, (-22000000,-11000000 22000000,11000000) for planar. For data sources like huge tileindexed raster layers, this is... painful indeed. Instead of no-op on a layer which is basically guaranteed to not be in the output, we check the complete contents.

Attachments

msprojectrect1.patch Download (10.0 KB) - added by pramsey 4 years ago.

Change History

Changed 4 years ago by warmerdam

  • cc warmerdam added
  • keywords projections added

Changed 4 years ago by pramsey

Changed 4 years ago by pramsey

It might be better to move the solution to this problem up a level, and at the start of a layer draw, pull both the source and destination rectangles into lonlat, and compare them for intersection there. That would be guaranteed to work and more aesthetically pleasing than assuming that a dest->source projection failure implies either 100% coverage (current assumption) or 0% coverage (my patch assumption).

Changed 4 years ago by pramsey

  • status changed from new to closed
  • resolution set to fixed

The solution suggested in my previous comment was in fact implemented, I am closing this ticket.

Note: See TracTickets for help on using tickets.