Skip to content

Commit

Permalink
Allow paging for msQueryByFilter().
Browse files Browse the repository at this point in the history
  • Loading branch information
sdlime committed Mar 2, 2017
1 parent f8ec673 commit 761a73a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mapquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ int msQueryByFilter(mapObj *map)
rectObj search_rect;

shapeObj shape;
int paging;

int nclasses = 0;
int *classgroup = NULL;
Expand Down Expand Up @@ -731,12 +732,14 @@ int msQueryByFilter(mapObj *map)
if((lp->mingeowidth > 0) && ((map->extent.maxx - map->extent.minx) < lp->mingeowidth)) continue;
}

paging = msLayerGetPaging(lp);
msLayerClose(lp); /* reset */
status = msLayerOpen(lp);
if(status != MS_SUCCESS) goto query_error;
msLayerEnablePaging(lp, paging);

/* disable driver paging */
msLayerEnablePaging(lp, MS_FALSE);
// msLayerEnablePaging(lp, MS_FALSE);

old_filteritem = lp->filteritem; /* cache the existing filter/filteritem */
msInitExpression(&old_filter);
Expand Down Expand Up @@ -816,7 +819,7 @@ int msQueryByFilter(mapObj *map)
#endif

/* Should we skip this feature? */
if (!msLayerGetPaging(lp) && map->query.startindex > 1) {
if (!paging && map->query.startindex > 1) {
--map->query.startindex;
msFreeShape(&shape);
continue;
Expand Down

0 comments on commit 761a73a

Please sign in to comment.