Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFS: Two requests issued for each page #8666

Closed
craigds opened this issue Nov 5, 2023 · 0 comments
Closed

WFS: Two requests issued for each page #8666

craigds opened this issue Nov 5, 2023 · 0 comments
Assignees

Comments

@craigds
Copy link
Contributor

craigds commented Nov 5, 2023

Thanks for the fix in #8654 ! Unfortunately it seems to have introduced a bug...

Expected behavior and actual behavior.

ogr2ogr should issue one request for each page when paginating a WFS datasource.

Instead, it now issues two requests for each page before moving on to the next page:

Steps to reproduce the problem.

$ ogr2ogr -f 'ESRI Shapefile' -sql 'select parcel_pfi, plan_number from "open-data-platform:v_s_parcel_proposed" order by "parcel_pfi"' out.shp 'WFS:https://opendata.maps.vic.gov.au/geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0' 2>&1 | grep CURL_INFO_HEADER_OUT
...
CURL_INFO_HEADER_OUT: GET /geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&TYPENAMES=open%2Ddata%2Dplatform:v_s_parcel_proposed&STARTINDEX=0&COUNT=5000&SORTBY=parcel_pfi&PROPERTYNAME=parcel_pfi,plan_number HTTP/2
CURL_INFO_HEADER_OUT: GET /geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&TYPENAMES=open%2Ddata%2Dplatform:v_s_parcel_proposed&STARTINDEX=0&COUNT=5000&SORTBY=parcel_pfi&PROPERTYNAME=parcel_pfi,plan_number HTTP/2
CURL_INFO_HEADER_OUT: GET /geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&TYPENAMES=open%2Ddata%2Dplatform:v_s_parcel_proposed&STARTINDEX=5000&COUNT=5000&SORTBY=parcel_pfi&PROPERTYNAME=parcel_pfi,plan_number HTTP/2
CURL_INFO_HEADER_OUT: GET /geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&TYPENAMES=open%2Ddata%2Dplatform:v_s_parcel_proposed&STARTINDEX=5000&COUNT=5000&SORTBY=parcel_pfi&PROPERTYNAME=parcel_pfi,plan_number HTTP/2
CURL_INFO_HEADER_OUT: GET /geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&TYPENAMES=open%2Ddata%2Dplatform:v_s_parcel_proposed&STARTINDEX=10000&COUNT=5000&SORTBY=parcel_pfi&PROPERTYNAME=parcel_pfi,plan_number HTTP/2
CURL_INFO_HEADER_OUT: GET /geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&TYPENAMES=open%2Ddata%2Dplatform:v_s_parcel_proposed&STARTINDEX=10000&COUNT=5000&SORTBY=parcel_pfi&PROPERTYNAME=parcel_pfi,plan_number HTTP/2
CURL_INFO_HEADER_OUT: GET /geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&TYPENAMES=open%2Ddata%2Dplatform:v_s_parcel_proposed&STARTINDEX=15000&COUNT=5000&SORTBY=parcel_pfi&PROPERTYNAME=parcel_pfi,plan_number HTTP/2
CURL_INFO_HEADER_OUT: GET /geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&TYPENAMES=open%2Ddata%2Dplatform:v_s_parcel_proposed&STARTINDEX=15000&COUNT=5000&SORTBY=parcel_pfi&PROPERTYNAME=parcel_pfi,plan_number HTTP/2
...

Note two requests are issued for each value of STARTINDEX. This seems to be independent of the value of OGR_WFS_PAGE_SIZE

Operating system

MacOS 14.0

GDAL version and provenance

Master build (bug occurs with 7abdaf6 and doesn't occur with a10feb7)

@rouault rouault self-assigned this Nov 5, 2023
craigds pushed a commit to koordinates/gdal that referenced this issue Nov 6, 2023
craigds pushed a commit to koordinates/gdal that referenced this issue Nov 6, 2023
craigds pushed a commit to koordinates/gdal that referenced this issue Nov 6, 2023
craigds pushed a commit to koordinates/gdal that referenced this issue Nov 6, 2023
@rouault rouault closed this as completed in d6c3066 Nov 6, 2023
rouault added a commit that referenced this issue Nov 6, 2023
WFS: avoid GetFeature request to be emitted twice in GML streaming mode (fixes #8666, master only)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants