[Geoserver-devel] [JIRA] (GEOS-8211) WFS totalCount wrong with pagination

Lorenzo Natali created an issue

GeoServer / BugGEOS-8211

WFS totalCount wrong with pagination

Issue Type:

BugBug

Affects Versions:

2.10.4

Assignee:

Unassigned

Components:

WFS

Created:

06/Jul/17 3:02 PM

Priority:

MediumMedium

Reporter:

Lorenzo Natali

When you do a WFS request with JSON output format and pagination (startIndex, maxFeatures) you have totalFeatures that shows the total number of results for the query of the query.
*e.g. *
request: (maxFeatures: 20, startIndex: 20)

curl 'https://localhost:8080/geoserver/wfs?service=WFS&outputFormat=json' -H 'Pragma: no-cache' -H 'Origin: http://localhost:8081' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.8,it-IT;q=0.6,it;q=0.4' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Cache-Control: no-cache' -H 'Referer: http://localhost:8081/' -H 'Connection: keep-alive' --data-binary '<wfs:GetFeature startIndex="20" maxFeatures="20" service="WFS" version="1.1.0" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" 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.1.0/wfs.xsd"><wfs:Query typeName="topp:states" srsName="EPSG:4326"><ogc:Filter></ogc:Filter></wfs:Query></wfs:GetFeature>' --compressed

result:

{
    "type": "FeatureCollection",
    "totalFeatures": 49,
    "features": [
        {
            "type": "Feature",
            "id": "states.28",
            "geometry": {
                "type": "MultiPolygon",

But totalFeatures is wrong for the last page (startIndex: 40, maxFeatures:20). It seems to show only number or results in this page.

request:

curl 'https://localhost:8080/geoserver/wfs?service=WFS&outputFormat=json' -H 'Pragma: no-cache' -H 'Origin: http://localhost:8081' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.8,it-IT;q=0.6,it;q=0.4' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Cache-Control: no-cache' -H 'Referer: http://localhost:8081/' -H 'Connection: keep-alive' --data-binary '<wfs:GetFeature startIndex="40" maxFeatures="20" service="WFS" version="1.1.0" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" 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.1.0/wfs.xsd"><wfs:Query typeName="topp:states" srsName="EPSG:4326"><ogc:Filter></ogc:Filter></wfs:Query></wfs:GetFeature>' --compressed

response:

{
    "type": "FeatureCollection",
    "totalFeatures": 9,
    "features": [
        {
            "type": "Feature",
            "id": "states.28",
            "geometry": {
                "type": "MultiPolygon",

Tested with topp:states default layer.

Add Comment

Add Comment

Get JIRA notifications on your phone! Download the JIRA Cloud app here.


This message was sent by Atlassian JIRA (v1000.1101.0#100054-sha1:6f413c5)

Atlassian logo