Skip to content

Commit

Permalink
WMS: avoid wfs_use_default_extent_for_getfeature=false setting to ove…
Browse files Browse the repository at this point in the history
…rride the BBOX parameter when a vendor-specific FILTER is set
  • Loading branch information
rouault committed Feb 25, 2020
1 parent d007716 commit e108174
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion mapwms.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,29 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
#endif

/* Apply filter to this layer */
if( FLTApplyFilterToLayer(psNode, map, lp->index) != MS_SUCCESS ) {

/* But first, start by removing any wfs_use_default_extent_for_getfeature metadata item */
/* that could result in the BBOX to be removed */
char* old_value_wfs_use_default_extent_for_getfeature = NULL;
{
const char* old_value_tmp = msLookupHashTable(
&(lp->metadata), "wfs_use_default_extent_for_getfeature");
if( old_value_tmp )
{
old_value_wfs_use_default_extent_for_getfeature = msStrdup(old_value_tmp);
msRemoveHashTable(&(lp->metadata), "wfs_use_default_extent_for_getfeature");
}
}

int ret = FLTApplyFilterToLayer(psNode, map, lp->index);
if( old_value_wfs_use_default_extent_for_getfeature )
{
msInsertHashTable(&(lp->metadata), "wfs_use_default_extent_for_getfeature",
old_value_wfs_use_default_extent_for_getfeature);
msFree(old_value_wfs_use_default_extent_for_getfeature);
}

if( ret != MS_SUCCESS ) {
errorObj* ms_error = msGetErrorObj();

if(ms_error->code != MS_NOTFOUND) {
Expand Down

0 comments on commit e108174

Please sign in to comment.