[mapserver-commits] r10827 - trunk/mapserver/mapscript/swiginc

svn at osgeo.org svn at osgeo.org
Mon Jan 3 00:54:54 EST 2011


Author: sdlime
Date: 2011-01-02 21:54:54 -0800 (Sun, 02 Jan 2011)
New Revision: 10827

Modified:
   trunk/mapserver/mapscript/swiginc/layer.i
   trunk/mapserver/mapscript/swiginc/map.i
Log:
Whoops, forgot all about the query changes (new method) resulting from RFC 64. This change merges those and introduces the queryByFilter() method to SWIG-based MapScript. (#3613)

Modified: trunk/mapserver/mapscript/swiginc/layer.i
===================================================================
--- trunk/mapserver/mapscript/swiginc/layer.i	2011-01-03 05:28:27 UTC (rev 10826)
+++ trunk/mapserver/mapscript/swiginc/layer.i	2011-01-03 05:54:54 UTC (rev 10827)
@@ -269,6 +269,29 @@
     /* For querying, we switch layer status ON and then back to original
        value before returning. */
 
+    int queryByFilter(mapObj *map, char *string)
+    {
+        int status;
+        int retval;
+
+        msInitQuery(&(map->query));
+
+        map->query.type = MS_QUERY_BY_FILTER;
+
+        map->query.filter = (expressionObj *) malloc(sizeof(expressionObj));
+        map->query.filter->string = strdup(string);
+	map->query.filter->type = 2000; /* MS_EXPRESSION: lot's of conflicts in mapfile.h */
+
+        map->query.layer = self->index;
+     	map->query.rect = map->extent;
+
+	status = self->status;
+	self->status = MS_ON;
+        retval = msQueryByFilter(map);
+        self->status = status;
+	return retval;
+    }
+
     int queryByAttributes(mapObj *map, char *qitem, char *qstring, int mode) 
     {
         int status;

Modified: trunk/mapserver/mapscript/swiginc/map.i
===================================================================
--- trunk/mapserver/mapscript/swiginc/map.i	2011-01-03 05:28:27 UTC (rev 10826)
+++ trunk/mapserver/mapscript/swiginc/map.i	2011-01-03 05:54:54 UTC (rev 10827)
@@ -240,6 +240,20 @@
       return NULL;	
   }
 
+  int queryByFilter(char *string) {
+    msInitQuery(&(self->query));
+
+    self->query.type = MS_QUERY_BY_FILTER;
+
+    self->query.filter = (expressionObj *) malloc(sizeof(expressionObj));
+    self->query.filter->string = strdup(string);
+    self->query.filter->type = 2000; /* MS_EXPRESSION: lot's of conflicts in mapfile.h */
+
+    self->query.rect = self->extent;
+
+    return msQueryByFilter(self);
+  }
+
   int queryByPoint(pointObj *point, int mode, double buffer) {
     msInitQuery(&(self->query));
 



More information about the mapserver-commits mailing list