Ticket #2678 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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

Changed 5 years ago by warmerdam

  • status changed from new to assigned
  • component changed from default to OGR_SRS
  • milestone set to 1.5.4

I will address this for 1.6.0 and 1.5.4.

Changed 5 years ago by warmerdam

  • priority changed from normal to high

Changed 5 years ago by warmerdam

  • status changed from assigned to closed
  • resolution set to fixed

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.