Skip to content

Commit 6f293c3

Browse files
author
Alan Boudreault
committed
Fix in msQueryBy* functions to support the startindex from MapScript
1 parent bf0c298 commit 6f293c3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

mapquery.c

+24
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,10 @@ int msQueryByAttributes(mapObj *map)
622622

623623
lp = (GET_LAYER(map, map->query.layer));
624624

625+
/* using mapscript, the map->query.startindex will be unset... */
626+
if (lp->startindex > 1 && map->query.startindex < 0)
627+
map->query.startindex = lp->startindex;
628+
625629
/* conditions may have changed since this layer last drawn, so set
626630
layer->project true to recheck projection needs (Bug #673) */
627631
lp->project = MS_TRUE;
@@ -826,6 +830,10 @@ int msQueryByFilter(mapObj *map)
826830
else if (map->query.maxfeatures > 0)
827831
lp->maxfeatures = map->query.maxfeatures;
828832

833+
/* using mapscript, the map->query.startindex will be unset... */
834+
if (lp->startindex > 1 && map->query.startindex < 0)
835+
map->query.startindex = lp->startindex;
836+
829837
/* conditions may have changed since this layer last drawn, so set
830838
layer->project true to recheck projection needs (Bug #673) */
831839
lp->project = MS_TRUE;
@@ -1017,6 +1025,10 @@ int msQueryByRect(mapObj *map)
10171025
else if (map->query.maxfeatures > 0)
10181026
lp->maxfeatures = map->query.maxfeatures;
10191027

1028+
/* using mapscript, the map->query.startindex will be unset... */
1029+
if (lp->startindex > 1 && map->query.startindex < 0)
1030+
map->query.startindex = lp->startindex;
1031+
10201032
/* conditions may have changed since this layer last drawn, so set
10211033
layer->project true to recheck projection needs (Bug #673) */
10221034
lp->project = MS_TRUE;
@@ -1255,6 +1267,10 @@ int msQueryByFeatures(mapObj *map)
12551267
else if (map->query.maxfeatures > 0)
12561268
lp->maxfeatures = map->query.maxfeatures;
12571269

1270+
/* using mapscript, the map->query.startindex will be unset... */
1271+
if (lp->startindex > 1 && map->query.startindex < 0)
1272+
map->query.startindex = lp->startindex;
1273+
12581274
/* conditions may have changed since this layer last drawn, so set
12591275
layer->project true to recheck projection needs (Bug #673) */
12601276
lp->project = MS_TRUE;
@@ -1559,6 +1575,10 @@ int msQueryByPoint(mapObj *map)
15591575
else if (map->query.maxfeatures > 0)
15601576
lp->maxfeatures = map->query.maxfeatures;
15611577

1578+
/* using mapscript, the map->query.startindex will be unset... */
1579+
if (lp->startindex > 1 && map->query.startindex < 0)
1580+
map->query.startindex = lp->startindex;
1581+
15621582
/* conditions may have changed since this layer last drawn, so set
15631583
layer->project true to recheck projection needs (Bug #673) */
15641584
lp->project = MS_TRUE;
@@ -1781,6 +1801,10 @@ int msQueryByShape(mapObj *map)
17811801
else if (map->query.maxfeatures > 0)
17821802
lp->maxfeatures = map->query.maxfeatures;
17831803

1804+
/* using mapscript, the map->query.startindex will be unset... */
1805+
if (lp->startindex > 1 && map->query.startindex < 0)
1806+
map->query.startindex = lp->startindex;
1807+
17841808
/* conditions may have changed since this layer last drawn, so set
17851809
layer->project true to recheck projection needs (Bug #673) */
17861810
lp->project = MS_TRUE;

0 commit comments

Comments
 (0)