Opened 10 years ago

Closed 4 years ago

#4653 closed defect (fixed)

EPSG 27200 ESRI WKT reads OK but fails Validate

Reported by: softree Owned by: Kyle Shannon
Priority: normal Milestone:
Component: OGR_SRS Version: 1.8.1
Severity: normal Keywords: ESRI morph WKT
Cc: esrixz, gaopeng


Using c++ class OGRSpatialReference. Create ESRI WKT from EPSG 27200 using morphToESRI() and exportToWkt(); then try to load this projection using importFromESRI() (which calls morphFromESRI(); Validate() fails: "PARAMETER Longitude_Of_Origin for PROJECTION New_Zealand_Map_Grid is an alias for central_meridian.".

Summary: morphToESRI() changes "central_meridian" to "Longitude_Of_Origin" (see apszParamNameMapping[]). morphFromESRI() does NOT switch these parameters back. ValidateProjection() fails.

Perhaps this should be part of ticket #4378.

Change History (4)

comment:1 by warmerdam, 10 years ago

Cc: esrixz gaopeng added

The problem can be demonstrated with this script:

from osgeo import osr

srs = osr.SpatialReference()
print srs.ExportToPrettyWkt()
print srs.ExportToPrettyWkt()
print srs.Validate()

I have briefly reviewed ogr_srs_esri.cpp and I don't see why central_meridian is being mapped to Longitude_Of_Origin by it. Likely it is due to a lookup in some supporting file. I also don't know why this isn't being reversed properly.

Added folks from ESRI who might like this to work better. I'm not planning on pursuing this right away myself.

comment:2 by Kyle Shannon, 7 years ago

Milestone: 2.1.0
Owner: changed from warmerdam to Kyle Shannon
Status: newassigned

comment:3 by Even Rouault, 6 years ago

Milestone: 2.1.0


comment:4 by Even Rouault, 4 years ago

Resolution: fixed
Status: assignedclosed

This issue is no longer current. Longitude_of_origin from ESRI WKT is mapped back to central_meridian to OGC WKT

Note: See TracTickets for help on using tickets.