[gdal-dev] Testing if two spatial references are the same

Frank Warmerdam warmerdam at pobox.com
Sat Dec 29 15:23:58 EST 2007


Simon Perkins wrote:
> Hmm, looking at the projection string in more detail and comparing with 
> the OGR source code, I see that it doesn't include a "PROJECTION" node, 
> which OGR.IsSame() checks for.
> 
> PROJCS["unnamed",
>   GEOGCS["NAD83",
>       DATUM["North_American_Datum_1983",
>           SPHEROID["GRS 1980",6378137,298.2572221010002,
>               AUTHORITY["EPSG","7019"]],
>           AUTHORITY["EPSG","6269"]],
>       PRIMEM["Greenwich",0],
>       UNIT["degree",0.0174532925199433],
>       AUTHORITY["EPSG","4269"]],
>   UNIT["US survey foot",0.3048006096012192,
>       AUTHORITY["EPSG","9003"]],
>   AUTHORITY["EPSG","26942"]]
> 
> So, is the TIFF file this came from missing some information? It was 
> just a file I found on the web... It does have an EPSG code, so should 
> IsSame() be checking for that?

Simon,

There is something seriously messed up abut this coordinate system.
Normally EPSG:26942 would look like:

PROJCS["NAD83 / California zone 2",
     GEOGCS["NAD83",
         DATUM["North_American_Datum_1983",
             SPHEROID["GRS 1980",6378137,298.257222101,
                 AUTHORITY["EPSG","7019"]],
             AUTHORITY["EPSG","6269"]],
         PRIMEM["Greenwich",0,
             AUTHORITY["EPSG","8901"]],
         UNIT["degree",0.01745329251994328,
             AUTHORITY["EPSG","9122"]],
         AUTHORITY["EPSG","4269"]],
     UNIT["metre",1,
         AUTHORITY["EPSG","9001"]],
     PROJECTION["Lambert_Conformal_Conic_2SP"],
     PARAMETER["standard_parallel_1",39.83333333333334],
     PARAMETER["standard_parallel_2",38.33333333333334],
     PARAMETER["latitude_of_origin",37.66666666666666],
     PARAMETER["central_meridian",-122],
     PARAMETER["false_easting",2000000],
     PARAMETER["false_northing",500000],
     AUTHORITY["EPSG","26942"]]

The behavior of the IsSame() method is questionable in
this situation, but in any event the spatial reference is
improperly formed.  I'd be interested in tracking down how
this corrupt coordinate system is being produced if you can
file an appropriate bug report.

Best regards

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list