Opened 11 years ago

Closed 11 years ago

#2678 closed defect (fixed)

OGRSpatialReference::Validate() fails on PROJCS/..."EXTENSION"

Reported by: mrosen Owned by: warmerdam
Priority: high Milestone: 1.5.4
Component: OGR_SRS Version: unspecified
Severity: normal Keywords:
Cc:

Description

LT was asked about supporting the Google Projection: http://spatialreference.org/ref/user/google-projection/

PROJCS["unnamed",
    GEOGCS["unnamed ellipse",
        DATUM["unknown",
            SPHEROID["unnamed",6378137,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Mercator_2SP"],
    PARAMETER["standard_parallel_1",0],
    PARAMETER["central_meridian",0],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["Meter",1],
    EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"]]

When we pass this to OGRSpatialReference::importFromWkt(), it parses OK but when we then call the OGRSpatialReference::Validate() method, it fails due to

OGRSpatialReference::Validate: Unexpected child for PROJCS `EXTENSION’

We are GDAL 1.4.2 but the Validate code seems to be the same on the trunk.

Change History (3)

comment:1 Changed 11 years ago by warmerdam

Component: defaultOGR_SRS
Milestone: 1.5.4
Status: newassigned

I will address this for 1.6.0 and 1.5.4.

comment:2 Changed 11 years ago by warmerdam

Priority: normalhigh

comment:3 Changed 11 years ago by warmerdam

Resolution: fixed
Status: assignedclosed

I have modified Validate() to consider EXTENSION nodes as a child of PROJCS[] valid. I also modified the StripCTParms() method to strip EXTENSION[] nodes. Change applied in trunk (r15730), and 1.5 (r15731).

No test suite changes were made to check this change.

Note: See TracTickets for help on using tickets.