OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.67k stars 2.47k forks source link

Doc: ESRIJSON Example Fails #7901

Closed micahcochran closed 1 year ago

micahcochran commented 1 year ago

Expected behavior and actual behavior.

ESRIJSON lists an example using ogrinfo:

ogrinfo -ro -al "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json"

When ran it results in the following:

ERROR 1: Could not resolve host: sampleserver3.arcgisonline.com
FAILURE:
Unable to open datasource `http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json' with the following drivers.
  -> FITS
  -> PCIDSK
  -> netCDF
  -> PDS4
  -> VICAR
[...snip...]

This seems to be that server is not online. I found this post on ESRI forums that "sampleserver1 thru 5 machines were all retired once earlier this year, but some came back to life for a few months. They are going away for good now." Source

Steps to reproduce the problem.

Run the example from the documentation for ESRIJSON.

Operating system

GDAL version and provenance

Potential Fix

I found this server up https://sampleserver6.arcgisonline.com/arcgis/rest/

Here is a query that I could get to work:

ogrinfo -ro -al "https://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer/0/query?where=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&gdbVersion=&historicMoment=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=xyFootprint&resultOffset=&resultRecordCount=10&returnTrueCurves=false&returnExceededLimitFeatures=false&quantizationParameters=&returnCentroid=false&timeReferenceUnknownClient=false&sqlFormat=none&resultType=&featureEncoding=esriDefault&datumTransformation=&f=pjson"

I limited the results to 10 records. The fix seems to be just to replace that line in the documentation with this one. Any thoughts?

rouault commented 1 year ago

The fix seems to be just to replace that line in the documentation with this one. Any thoughts?

sounds good.

You may use https://github.com/OSGeo/gdal/edit/master/doc/source/drivers/vector/esrijson.rst to propose that change