Ticket #4281 (closed defect: invalid)
OGRSpatialReference::IsSameGeogCS() does not check for "unknown" datum values
| Reported by: | etourigny | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | OGR_SRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
When a datum with value "unknown" is compared to a known datum with same spheroid(numerically), IsSameGeogCS() returns false.
The following one-liner fix resolves the problem:
if( pszThisValue != NULL && pszOtherValue != NULL
+ && !EQUAL(pszThisValue,"unknown") && !EQUAL(pszOtherValue,"unknown")
&& !EQUAL(pszThisValue,pszOtherValue) )
return FALSE;
Example WKT illustrating the problem:
PROJCS["unnamed",
GEOGCS["unknown",
DATUM[,
SPHEROID["Spheroid",6378137,298.2572221010002]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["Lambert_Conformal_Conic_2SP"],
PARAMETER["standard_parallel_1",-18],
PARAMETER["standard_parallel_2",-36],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",134],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0]]
PROJCS["GDA94 / Geoscience Australia Lambert",
GEOGCS["GDA94",
DATUM["Geocentric_Datum_of_Australia_1994",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY["EPSG","6283"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4283"]],
PROJECTION["Lambert_Conformal_Conic_2SP"],
PARAMETER["standard_parallel_1",-18],
PARAMETER["standard_parallel_2",-36],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",134],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","3112"]]
Change History
Note: See
TracTickets for help on using
tickets.
