Skip to content

Commit

Permalink
Only select requested fields for all WFS query types (#6288)
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Apr 15, 2021
1 parent 7e7464e commit b5d02c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
9 changes: 9 additions & 0 deletions maplayer.c
Expand Up @@ -990,6 +990,15 @@ int msLayerWhichItems(layerObj *layer, int get_all, const char *metadata)
get_all = MS_FALSE;
}

if(metadata == NULL){
// check item set by mapwfs.cpp to restrict the number of columns selected
metadata = msOWSLookupMetadata(&(layer->metadata), "G", "select_items");
if (metadata) {
/* get only selected items */
get_all = MS_FALSE;
}
}

/* always retrieve all items in some cases */
if(layer->connectiontype == MS_INLINE ||
(layer->map->outputformat && layer->map->outputformat->renderer == MS_RENDER_WITH_KML)) {
Expand Down
13 changes: 2 additions & 11 deletions mapquery.c
Expand Up @@ -1115,17 +1115,8 @@ int msQueryByRect(mapObj *map)
}
msLayerEnablePaging(lp, paging);

// Item set by mapwfs.cpp to restrict the number of columns selected
const char *value = msOWSLookupMetadata(&(lp->metadata), "G", "select_items");
if(value){
/* get only selected items */
status = msLayerWhichItems(lp, MS_FALSE, value);
}
else {
/* build item list, we want *all* items */
status = msLayerWhichItems(lp, MS_TRUE, NULL);
}

/* build item list, we want *all* items */
status = msLayerWhichItems(lp, MS_TRUE, NULL);

if(status != MS_SUCCESS) {
msFreeShape(&searchshape);
Expand Down

0 comments on commit b5d02c5

Please sign in to comment.