Opened 15 years ago

Closed 15 years ago

#2844 closed defect (fixed)

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 (1)

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

Download all attachments as: .zip

Change History (4)

comment:1 by warmerdam, 15 years ago

Cc: warmerdam added
Keywords: projections added

by pramsey, 15 years ago

Attachment: msprojectrect1.patch added

comment:2 by pramsey, 15 years ago

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).

comment:3 by pramsey, 15 years ago

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.