[mapserver-commits] r9060 - branches/branch-5-4/mapserver/mapscript/swiginc

svn at osgeo.org svn at osgeo.org
Mon Jun 1 23:12:48 EDT 2009


Author: sdlime
Date: 2009-06-01 23:12:48 -0400 (Mon, 01 Jun 2009)
New Revision: 9060

Modified:
   branches/branch-5-4/mapserver/mapscript/swiginc/layer.i
Log:
Fixed whichShapes() to respect filters AND return all items. (#2689)

Modified: branches/branch-5-4/mapserver/mapscript/swiginc/layer.i
===================================================================
--- branches/branch-5-4/mapserver/mapscript/swiginc/layer.i	2009-05-30 10:56:03 UTC (rev 9059)
+++ branches/branch-5-4/mapserver/mapscript/swiginc/layer.i	2009-06-02 03:12:48 UTC (rev 9060)
@@ -156,12 +156,17 @@
 
     int whichShapes(rectObj rect)
     {
-        /* 
-        ** We assume folks use this like a simple query so retrieve all items with each shape.
-        */
-        if(msLayerWhichItems(self, MS_TRUE, MS_FALSE, NULL) != MS_SUCCESS) return MS_FAILURE;
+        int oldconnectiontype = self->connectiontype;
+        self->connectiontype = MS_INLINE;
+
+        if(msLayerWhichItems(self, MS_TRUE, MS_FALSE, NULL) != MS_SUCCESS) {
+            self->connectiontype = oldconnectiontype;
+            return MS_FAILURE;
+        }
+        self->connectiontype = oldconnectiontype;
+
         return msLayerWhichShapes(self, rect);
-    }	
+    }
 
     %newobject nextShape;
     shapeObj *nextShape() 



More information about the mapserver-commits mailing list