Bug report #18881

QGIS cannot recognise CRS from ESRI wkt on ArcGIS Feature Server

Added by Bruce Steedman almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Projection Support
Affected QGIS version:3.0.2 Regression?:No
Operating System:Ubuntu 18.04 LTS Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:26713

Description

I am using ArcGisFeatureServer to read Feature Layers from an ArcGIS server url:

https://roadworks.gov.je/arcgis/rest/services/JSW_With_Beach_Access/MapServer

All of the layers on this server use a CRS defined by ESRI wkt: PROJCS["NewJTM",GEOGCS["GCS_ETRF_1989",DATUM["D_ETRF_1989",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",40000.0],PARAMETER["False_Northing",70000.0],PARAMETER["Central_Meridian",-2.135],PARAMETER["Scale_Factor",0.9999999],PARAMETER["Latitude_Of_Origin",49.225],UNIT["Meter",1.0]]

This is the wkt for EPSG:3109, ETRS89 / Jersey Transverse Mercator see: http://prj2epsg.org/epsg/3109

However, after adding the server, if I choose a layer - e.g. layer 'Ambulance' - the crs in the properties has been read in as EPSG:4326. Please refer to attached screenshot.

When adding such a layer to my project (whose crs is also EPSG:3109) I get the following Warning in the CRS tab of the Log Messages panel: "WARNING Transform error caught: Could not transform bounding box to target CRS". The layer is not added to my project.

Steps to reproduce as above. No known workaround, but interestingly if I choose a layer whose Geomerty Type is esriGeometryPoint (e.g. layer 8) I get the same warning, but the layer is added.

Many thanks.

screen.png (157 KB) Bruce Steedman, 2018-04-29 08:49 PM

Associated revisions

Revision ea38c732
Added by Nyall Dawson almost 6 years ago

[afs] Fix handling of custom projections

Don't treat all unknown projections as WGS84

Fixes #18881

Revision 4d020416
Added by Nyall Dawson almost 6 years ago

[afs] Fix handling of custom projections

Don't treat all unknown projections as WGS84

Fixes #18881

(cherry-picked from ea38c732)

History

#1 Updated by Bruce Steedman almost 6 years ago

Update: I found a workaround; if I add the layer, edit the properties/Source and change the Coordinate reference system to the correct one (EPSG:3109) and apply, the layer is visible. Of course if I remove the layer and re-add it, the wrong crs is used again.

Also, I found an upstream GDAL bug which may be related: https://trac.osgeo.org/gdal/ticket/4345. It has a milestone of GDAL v2.3.0, so may be included in GDAL 2.3.0beta1 which is on GitHub since 20th April 2018: https://github.com/OSGeo/gdal/releases/tag/v2.3.0beta1. I am not able to test this until I figure out how to build it from source & build QGIS with this version of GDAL. In the meantime I will try and fork GDAL and add the wkt for EPSG:3109 into a unit test to see if it passes.

#2 Updated by Nyall Dawson almost 6 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Status changed from Open to In Progress

#3 Updated by Nyall Dawson almost 6 years ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

Also available in: Atom PDF