[Mapserver-dev] msProjectRect for degenerate rectangles?

Ed McNierney ed at topozone.com
Thu Mar 20 14:19:59 EST 2003


Folks -

Now that I can actually run queries on 3.7, they don't work <g>.  It appears that doing a simple single-layer point query (i.e. what object is this point in) for a data layer that's not in the MAP file's native projection doesn't work.  The query point is used to initialize a rectangle with no TOLERANCE values, so msQueryByPoint creates a degenerate rectangle object (minx == maxx, miny == maxy) and passes it to msProjectRect.  It *appears* that msProjectRect does the wrong thing - it looks to see if dx (deltax) is greater than 0, and calls msProjectGrowRect, then looks to see if dy (deltay) is greater than 0 and calls msProjectGrowRect again.

If dx == 0 and dy == 0 then the output rectangle's values are copied from prj_rect, which was never initialized.  So I get goofy results and the query doesn't work.

I'm really asking about what msProjectRect should do when passed a degenerate rectangle.  It seems to me that there's nothing really wrong with such a rectangle, and it ought to handle it just fine (i.e. the fix should be in msProjectRect).  But I don't know enough about its usage to be sure.

It seems like modifying the two tests (if (dx > 0), if (dy > 0)) to simply be >= tests would be fine.  Thoughts would be appreciated - thanks.

	- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242 




More information about the mapserver-dev mailing list