Opened 3 years ago

Closed 8 months ago

Last modified 8 months ago

#6112 closed defect (fixed)

GDAL cannot retrieve SRID from ArcGIS MapServer layer

Reported by: basteed Owned by: warmerdam
Priority: normal Milestone: 2.3.0
Component: default Version: 1.11.2
Severity: normal Keywords: WKID
Cc:

Description

I am trying to import a raster source into QGIS with SRS: EPSG:3109. See the error resulting from the following command:

$ gdal_translate --debug on "http://gps.digimap.gg/arcgis/rest/services/JerseyBaseMap/MapServer?f=json&pretty=true" JerseyBaseMapLayer.xml -of WMS
HTTP: Fetch(http://gps.digimap.gg/arcgis/rest/services/JerseyBaseMap/MapServer?f=json&pretty=true)
WMS: Did not get WKID
HTTP: Fetch(http://gps.digimap.gg/arcgis/rest/services/JerseyBaseMap/MapServer?f=json&pretty=true)
ERROR 4: `/tmp/file.dat' not recognised as a supported file format.

GDALOpen failed - 4
`/tmp/file.dat' not recognised as a supported file format.

Issue described here: http://gis.stackexchange.com/questions/162069/wkid-issue-when-adding-raster-layer-from-arcgis-mapserver-to-qgis-via-rest

gdal installed via homebrew on Mac OS X 10.9.5

Change History (5)

comment:1 Changed 3 years ago by Even Rouault

Milestone: 1.11.3
Summary: gdal_translate cannot get WKID from raster sourceGDAL cannot retrieve SRID from ArcGIS MapServer layer

comment:2 Changed 3 years ago by basteed

Upon further investigation, it appears that the error is raised due to this map server's JSON "spatialReference" values using a "wkt" key in favour of either "wkid" or latestWkid" keys. JSON on map servers using these latter type can be successfully parsed/translated.

The particular piece of code responsible appears to be the GDALWMSDatasetGetConfigFromArcGISJSON method - line 433 in the WMS driver here: https://github.com/etiennesky/gdal-netcdf/blob/master/gdal/frmts/wms/wmsdriver.cpp

What I don't understand is why this method does not also parse the value for a "wkt" key and translate that from various recognised formats (PROJ is used in the example I gave).

comment:3 Changed 8 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40212:

WMS: ArcGIS miniserver: use latestWkid and wkt metadata (fixes #6112)

comment:4 Changed 8 months ago by Even Rouault

Milestone: 2.3.0

comment:5 Changed 8 months ago by basteed

Many thanks for the fix.

Note: See TracTickets for help on using tickets.