Skip to content
Permalink
Browse files

Merge pull request #5913 from rouault/offset-ogr

Wrong OFFSET in query for CONNECTIONTYPE OGR
  • Loading branch information...
rouault committed Nov 3, 2019
2 parents 9f3f823 + ae2c650 commit 0fcc810f0b559c800f950db78a79fa6574799f23
@@ -2503,7 +2503,7 @@ static int msOGRFileWhichShapes(layerObj *layer, rectObj rect, msOGRFileInfo *ps

if ( !bOffsetAlreadyAdded && psInfo->bPaging && layer->startindex > 0 ) {
char szOffset[50];
snprintf(szOffset, sizeof(szOffset), " OFFSET %d", layer->startindex);
snprintf(szOffset, sizeof(szOffset), " OFFSET %d", layer->startindex-1);
select = msStringConcatenate(select, szOffset);
}

Binary file not shown.
@@ -0,0 +1,68 @@
Content-Type: text/xml; charset=UTF-8

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd
http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=popplace&amp;OUTPUTFORMAT=XMLSCHEMA">
<gml:boundedBy>
<gml:Box srsName="EPSG:4326">
<gml:coordinates>-64.333577,44.375794 -60.981038,46.980843</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ms:popplace>
<ms:NAME>&quot;Tignish</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>&#39;Cheticamp</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Sheet Harbour</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>&#39;Souris&#39;</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>&quot;Canso&quot;</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Port Hawkesbury</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Antigonish</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Springhill</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>&quot;Wind&quot;sor</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Lunenburg</ms:NAME>
</ms:popplace>
</gml:featureMember>
</wfs:FeatureCollection>

@@ -0,0 +1,68 @@
Content-Type: text/xml; charset=UTF-8

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd
http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=popplace&amp;OUTPUTFORMAT=XMLSCHEMA">
<gml:boundedBy>
<gml:Box srsName="EPSG:4326">
<gml:coordinates>-65.816024,43.740118 -59.972676,46.431271</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Liverpool</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Middleton</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Digby</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Shelburne</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Summerside</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Glace Bay</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>New Glasgow</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Tr&quot;uro</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Amherst</ms:NAME>
</ms:popplace>
</gml:featureMember>
<gml:featureMember>
<ms:popplace>
<ms:NAME>Kentville</ms:NAME>
</ms:popplace>
</gml:featureMember>
</wfs:FeatureCollection>

@@ -4,6 +4,10 @@
# REQUIRES: SUPPORTS=WFS INPUT=OGR
#
# RUN_PARMS: wfs_ogr_gpkg_issue_5858.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=test&BBOX=-180,-90,180,90&MAXFEATURES=1" > [RESULT]
#
# Filter using startIndex
# RUN_PARMS: wfs_ogr_gpkg_filter_startindex.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=popplace&propertyname=(name)&maxfeatures=10&startindex=0" > [RESULT]
# RUN_PARMS: wfs_ogr_gpkg_filter_startindex2.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=popplace&propertyname=(name)&maxfeatures=10&startindex=10" > [RESULT]

MAP

@@ -60,4 +64,22 @@ LAYER
TEMPLATE "wfs_ogr_gpkg.map"
END # Layer

LAYER

NAME popplace
CONNECTIONTYPE OGR
CONNECTION "./data/popplace.gpkg"
METADATA
"wfs_title" "popplace"
"wfs_description" "Cities"
"wfs_result_fields" "name"
"gml_include_items" "all"
END
TYPE POINT
STATUS ON
PROJECTION
"init=epsg:3978"
END
END # Layer

END # Map File

0 comments on commit 0fcc810

Please sign in to comment.
You can’t perform that action at this time.