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

Simon Perkins sy at perkins.net
Wed Jan 2 17:35:36 EST 2008


Hi Frank,

The original TIFF file can be found here:

http://www.city.davis.ca.us/gis/data/aerial/2005/K10.tif

It's about 32MB in size.

Alternatively, listgeo displays the following information for the file:

Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                0                0               
         6625559.25       1975040.25       0               
      ModelPixelScaleTag (1,3):
         0.499999         0.499999         0               
      End_Of_Tags.
   Keyed_Information:
      GTModelTypeGeoKey (Short,1): ModelTypeProjected
      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
      GTCitationGeoKey (Ascii,12): "GeoTIFF 1.0"
      ProjectedCSTypeGeoKey (Short,1): PCS_NAD83_California_2
      PCSCitationGeoKey (Ascii,28): "California Zone II (NAD 83)"
      ProjLinearUnitsGeoKey (Short,1): Linear_Foot_US_Survey
      End_Of_Keys.
   End_Of_Geotiff.

PCS = 26942 (name unknown)
Projection = 10432 ()
GCS: 4269/NAD83
Datum: 6269/North American Datum 1983
Ellipsoid: 7019/GRS 1980 (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
Projection Linear Units: 9003/(unknown) (1.000000m)

Corner Coordinates:
Upper Left    ( 6625559.250, 1975040.248)
Lower Left    ( 6625559.250, 1974038.750)
Upper Right   ( 6628236.245, 1975040.248)
Lower Right   ( 6628236.245, 1974038.750)
Center        ( 6626897.747, 1974539.499)

See anything obviously wrong there?

Cheers,

Sy



Frank Warmerdam wrote:
> 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
>



More information about the gdal-dev mailing list