Opened 12 years ago

Closed 6 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

Description

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, 12 years ago

Cc: esrixz gaopeng added

The problem can be demonstrated with this script:

from osgeo import osr

srs = osr.SpatialReference()
srs.SetFromUserInput('EPSG:27200')
print srs.ExportToPrettyWkt()
srs.MorphToESRI()
srs.MorphFromESRI()
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, 9 years ago

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

comment:3 by Even Rouault, 8 years ago

Milestone: 2.1.0

Unmiletoning

comment:4 by Even Rouault, 6 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.