[mapserver-commits] r9561 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Nov 25 09:50:56 EST 2009


Author: sdlime
Date: 2009-11-25 09:50:54 -0500 (Wed, 25 Nov 2009)
New Revision: 9561

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapquery.c
Log:
Fixed a problem with shape-based queries against projected layers when using a tolerance (#3211)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-11-23 20:26:44 UTC (rev 9560)
+++ trunk/mapserver/HISTORY.TXT	2009-11-25 14:50:54 UTC (rev 9561)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Fixed a problem with shape-based queries against projected layers when using a tolerance (#3211)
+
 - Fixed long expression evaluation (#2123) 
 
 - Added simplfy and topologyPreservingSimplify to MapScript (#2753)

Modified: trunk/mapserver/mapquery.c
===================================================================
--- trunk/mapserver/mapquery.c	2009-11-23 20:26:44 UTC (rev 9560)
+++ trunk/mapserver/mapquery.c	2009-11-25 14:50:54 UTC (rev 9561)
@@ -847,7 +847,7 @@
       tolerance = layer_tolerance * msAdjustExtent(&(map->extent), map->width, map->height);
     else
       tolerance = layer_tolerance * (msInchesPerUnit(lp->toleranceunits,0)/msInchesPerUnit(map->units,0));
-   
+
     /* open this layer */
     status = msLayerOpen(lp);
     if(status != MS_SUCCESS) return(MS_FAILURE);
@@ -884,6 +884,11 @@
       /* identify target shapes */
       searchrect = selectshape.bounds;
 
+      searchrect.minx -= tolerance; /* expand the search box to account for layer tolerances (e.g. buffered searches) */
+      searchrect.maxx += tolerance;
+      searchrect.miny -= tolerance;
+      searchrect.maxy += tolerance;
+
 #ifdef USE_PROJ
       if(lp->project && msProjectionsDiffer(&(lp->projection), &(map->projection)))      
 	msProjectRect(&(map->projection), &(lp->projection), &searchrect); /* project the searchrect to source coords */
@@ -891,11 +896,6 @@
 	lp->project = MS_FALSE;
 #endif
 
-      searchrect.minx -= tolerance; /* expand the search box to account for layer tolerances (e.g. buffered searches) */
-      searchrect.maxx += tolerance;
-      searchrect.miny -= tolerance;
-      searchrect.maxy += tolerance;
-
       status = msLayerWhichShapes(lp, searchrect);
       if(status == MS_DONE) { /* no overlap */
 	msLayerClose(lp);
@@ -1334,6 +1334,12 @@
 
     /* identify target shapes */
     searchrect = qshape->bounds;
+
+    searchrect.minx -= tolerance; /* expand the search box to account for layer tolerances (e.g. buffered searches) */
+    searchrect.maxx += tolerance;
+    searchrect.miny -= tolerance;
+    searchrect.maxy += tolerance;
+
 #ifdef USE_PROJ
     if(lp->project && msProjectionsDiffer(&(lp->projection), &(map->projection)))
       msProjectRect(&(map->projection), &(lp->projection), &searchrect); /* project the searchrect to source coords */
@@ -1341,11 +1347,6 @@
       lp->project = MS_FALSE;
 #endif
 
-    searchrect.minx -= tolerance; /* expand the search box to account for layer tolerances (e.g. buffered searches) */
-    searchrect.maxx += tolerance;
-    searchrect.miny -= tolerance;
-    searchrect.maxy += tolerance;
-
     status = msLayerWhichShapes(lp, searchrect);
     if(status == MS_DONE) { /* no overlap */
       msLayerClose(lp);



More information about the mapserver-commits mailing list