Opened 8 years ago

Closed 4 years ago

Last modified 4 years ago

#3191 closed defect (fixed)

[PATCH] Lambert_Conformal_Conic_2SP: Central_Parallel vs. latitude_of_origin

Reported by: peifer Owned by: Kyle Shannon
Priority: normal Milestone: 1.10.1
Component: OGR_SRS Version: 1.10.0
Severity: normal Keywords: ogrspatialreference
Cc: Kyle Shannon

Description

I have a shapefile with the following SRS:

Layer SRS WKT:
PROJCS["Custom",
    GEOGCS["GCS_WGS_1984",
        DATUM["WGS_1984",
            SPHEROID["WGS_1984",6378137.0,298.257223563]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["False_Easting",0.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",10.5],
    PARAMETER["Standard_Parallel_1",48.66666666666666],
    PARAMETER["Standard_Parallel_2",53.66666666666666],
    PARAMETER["Central_Parallel",51.0],
    UNIT["Meter",1.0]]

It looks like GDAL/OGR does not understand PARAMETER["Central_Parallel",51.0] and subsequently, the features fall into Africa, about 5700 km South of their actual location. Changing the parameter name in the prj file to PARAMETER["latitude_of_origin",51.0] solves the issue. I guess there could be an alias Central_Parallel <-> latitude_of_origin ?

Attachments (1)

3191.patch (3.4 KB) - added by Kyle Shannon 4 years ago.
actual patch applied

Download all attachments as: .zip

Change History (9)

comment:1 Changed 4 years ago by 45136

Just another case, coming from an ESRI .prj file: http://gis.stackexchange.com/questions/67500/projection-issues-arcgis-to-qgis

The Central_parallel value gets lost when reading it with gdalsrsinfo, or loading into QGIS.

Reading this article, ESRI treat central_parallel and latitude_of_origin as the same: http://edndoc.esri.com/arcsde/9.2/concepts/geometry/coordref/coordsys/projected/mapprojections.htm

So I suggest GDAL should do the same when reading WKT.

comment:2 Changed 4 years ago by 45136

Version: 1.6.21.10.0

comment:3 Changed 4 years ago by Kyle Shannon

Cc: Kyle Shannon added
Keywords: ogrspatialreference added
Milestone: 1.10.1
Summary: Lambert_Conformal_Conic_2SP: Central_Parallel vs. latitude_of_origin[PATCH] Lambert_Conformal_Conic_2SP: Central_Parallel vs. latitude_of_origin

45136, Attached is a patch for review. OSR isn't my area of expertise, but I tried to match up with how other SRSs are handled. Hopefully someone will take a peek and vet it. Then either they can apply it or I can.

comment:4 Changed 4 years ago by Kyle Shannon

Also, test data would be helpful. I used the wkt on the ticket for a simple test in the python autotest suite, but a few more would be nice.

comment:5 Changed 4 years ago by Even Rouault

Kyle, this looks good to me. You can apply.

comment:6 Changed 4 years ago by Kyle Shannon

Owner: changed from warmerdam to Kyle Shannon
Status: newassigned

comment:7 Changed 4 years ago by Kyle Shannon

Resolution: fixed
Status: assignedclosed

I couldn't find enough evidence in the wild to add it to morphToESRI(), but morphFromESRI support is added. Fixed in trunk r26257 and branches/1.10 r26257.

comment:8 Changed 4 years ago by Kyle Shannon

whoops, trunk r26257, branches/1.10 r26258

Changed 4 years ago by Kyle Shannon

Attachment: 3191.patch added

actual patch applied

Note: See TracTickets for help on using tickets.