Skip to content

Commit

Permalink
Whoops, forgot all about the query changes (new method) resulting fro…
Browse files Browse the repository at this point in the history
…m RFC 64. This change merges those and introduces the queryByFilter() method to SWIG-based MapScript. (#3613)

git-svn-id: http://svn.osgeo.org/mapserver/trunk@10827 7532c77e-422f-0410-93f4-f0b67bdd69e2
  • Loading branch information
sdlime committed Jan 3, 2011
1 parent 1e0207a commit 70e32f0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
23 changes: 23 additions & 0 deletions mapscript/swiginc/layer.i
Expand Up @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions mapscript/swiginc/map.i
Expand Up @@ -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));

Expand Down

0 comments on commit 70e32f0

Please sign in to comment.