Permalink
Browse files

Add support for empty WMS filters (RFC118)

  • Loading branch information...
dmorissette committed Sep 20, 2017
1 parent fedc614 commit 7096a10d8fdb490f6f6fa17ff7a67b4e5854cb54
@@ -376,6 +376,12 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
if (lp == NULL || lp->status != MS_ON)
continue;

/* Skip empty filters */
if (paszFilters[curfilter][0] == '\0') {
curfilter++;
continue;
}

/* Force setting a template to enable query. */
if (lp->template == NULL)
lp->template = msStrdup("ttt.html");
@@ -460,9 +466,6 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,

}/* for */

// TODO: Set query_map_mode w/ default style...


return MS_SUCCESS;
}

@@ -3837,7 +3840,6 @@ int msWMSGetMap(mapObj *map, int nVersion, char **names, char **values, int nume
for (i=0; i<numentries; i++) {
if ((strcasecmp(names[i], "FILTER") == 0 && values[i] && strlen(values[i]) > 0)) {
drawquerymap = MS_TRUE;
// TODO: Do we want to allow both selected and hilite?
map->querymap.status = MS_ON;
map->querymap.style = MS_SELECTED;
break;
Binary file not shown.
@@ -19,7 +19,9 @@
# GetMap 1.3.0 two layers, with dwithin filter
# RUN_PARMS: wms_filter_getmap130_dwithin2.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG%3A4326&BBOX=40,-70,50,-60&WIDTH=400&HEIGHT=400&LAYERS=road,popplace&STYLES=&FORMAT=image%2Fpng&BGCOLOR=0xFFFFFF&TRANSPARENT=FALSE&EXCEPTIONS=INIMAGE&FILTER=(<Filter><DWithin><PropertyName>Geometry</PropertyName><gml:Point><gml:coordinates>46,-63</gml:coordinates></gml:Point><Distance units='dd'>0.5</Distance></DWithin></Filter>)(<Filter><DWithin><PropertyName>Geometry</PropertyName><gml:Point><gml:coordinates>46,-63</gml:coordinates></gml:Point><Distance units='dd'>0.5</Distance></DWithin></Filter>)" > [RESULT_DEMIME]
#

# GetMap 1.3.0 two layers, one without and one with filter
# RUN_PARMS: wms_filter_getmap130_emptyfilter.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG%3A4326&BBOX=40,-70,50,-60&WIDTH=400&HEIGHT=400&LAYERS=road,popplace&STYLES=&FORMAT=image%2Fpng&BGCOLOR=0xFFFFFF&TRANSPARENT=FALSE&EXCEPTIONS=INIMAGE&FILTER=()(<Filter><PropertyIsEqualTo><PropertyName>NAME</PropertyName><Literal>Charlottetown</Literal></PropertyIsEqualTo></Filter>)" > [RESULT_DEMIME]
#

MAP

0 comments on commit 7096a10

Please sign in to comment.