Opened 7 months ago

Last modified 7 months ago

#6895 new defect

GeoJSON: ArcGIS-REST hardcoded variable

Reported by: TobWen Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Hi there,

in https://trac.osgeo.org/gdal/browser/trunk/autotest/ogr/ogr_geojson.py#L2259 the output-type &f=geojson is hardcoded.

This leads to Error 400 on several servers when this filetype has another name. On some servers, this output type is named &f=json or even &f=pjson (of course, GeoJSON gets delivered).

Solution: When there's a output-format string in the URL, you don't need to change it:

https://localhost/arcgis/rest/services/web/trees/MapServer/0/query?where=objectid+is+not+null&outFields=*&outSR=25832&resultRecordCount=500&f=json"

Change History (8)

comment:1 Changed 7 months ago by Even Rouault

Can be reproduced with "https://geoservice.bochum.de/arcgis/rest/services/Internet/Baumkataster/MapServer/0/query?where=objectid+is+not+null&outFields=*&resultRecordCount=500&f=json"

2 issues :

  • GetExtent?() indeed not working because f=geojson not supported and returnExtentOnly=true not supported in f=json
  • GetNextFeature?() doesn't support properly paging and iterates forever on the first features

comment:2 Changed 7 months ago by Even Rouault

Scrolling could potentially be implemnted by issuing a returnIdsOnly=true request, and then using requests like "where=OBJECTID < 50 AND OBJECTID > 0"

comment:3 Changed 7 months ago by Even Rouault

In 38519:

ESRIJson: avoid endless looping on servers that don't support resultOffset (refs #6895)

comment:4 Changed 7 months ago by Even Rouault

In 38520:

ESRIJson: avoid endless looping on servers that don't support resultOffset (refs #6895)

comment:5 Changed 7 months ago by Even Rouault

In 38521:

ESRIJson: avoid endless looping on servers that don't support resultOffset (refs #6895)

comment:6 in reply to:  1 Changed 7 months ago by TobWen

Replying to Even Rouault:

2 issues :

  • GetExtent?() indeed not working because f=geojson not supported and returnExtentOnly=true not supported in f=json
  • GetNextFeature?() doesn't support properly paging and iterates forever on the first features

Yep, paging got implemented in v10.3 and needs to be activated by the administrator. 10.1 and 10.2 don't support paging at all.

comment:7 in reply to:  2 Changed 7 months ago by TobWen

Replying to Even Rouault:

Scrolling could potentially be implemnted by issuing a returnIdsOnly=true request, and then using requests like "where=OBJECTID < 50 AND OBJECTID > 0"

Or (when the list has whole/jumps etc.): &objectIds=1,3,5,19,39,43 ... until the limit (normally of 1000).

comment:8 Changed 7 months ago by TobWen

Maybe even better: WHERE=OBJECTID_1 BETWEEN 1 and 1000

Note: See TracTickets for help on using tickets.