Opened 5 years ago

Closed 22 months ago

#4954 closed defect (fixed)

GDAL 1.9.2 reports incorrect coordinates in GeoTIFF file (NAD83 HARN+US Foot)

Reported by: jwderos Owned by: warmerdam
Priority: normal Milestone: 2.1.0
Component: GDAL_Raster Version: 1.10.1
Severity: normal Keywords:
Cc: Kyle Shannon

Description

I have some GeoTIFF files that should be in Montana but are off the coast of Washington. When I run gdalinfo using GDAL 1.8.1, they are correct:

$ gdalinfo mt_2770_1310.tif
Driver: GTiff/GeoTIFF
Files: mt_2770_1310.tif
Size is 5000, 5000
Coordinate System is:
PROJCS["NAD83(HARN) / Montana",
    GEOGCS["NAD83(HARN)",
        DATUM["NAD83_High_Accuracy_Regional_Network",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6152"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4152"]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",49],
    PARAMETER["standard_parallel_2",45],
    PARAMETER["latitude_of_origin",44.25],
    PARAMETER["central_meridian",-109.5],
    PARAMETER["false_easting",1968500],
    PARAMETER["false_northing",0],
    UNIT["US survey foot",0.3048006096012192,
        AUTHORITY["EPSG","9003"]],
    AUTHORITY["EPSG","2818"]]
Origin = (2770000.000000000000000,1320000.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Metadata:
  TIFFTAG_XRESOLUTION=0
  TIFFTAG_YRESOLUTION=0
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( 2770000.000, 1320000.000) (106d14' 5.16"W, 47d49'29.89"N)
Lower Left  ( 2770000.000, 1310000.000) (106d14'11.26"W, 47d47'51.24"N)
Upper Right ( 2780000.000, 1320000.000) (106d11'38.67"W, 47d49'25.75"N)
Lower Right ( 2780000.000, 1310000.000) (106d11'44.85"W, 47d47'47.10"N)
Center      ( 2775000.000, 1315000.000) (106d12'54.98"W, 47d48'38.50"N)
Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue
Band 4 Block=5000x1 Type=Byte, ColorInterp=Undefined

When I run the same thing in GDAL 1.9.2, I get this:

$ gdalinfo mt_2770_1290.tif
Driver: GTiff/GeoTIFF
Files: mt_2770_1290.tif
Size is 5000, 5000
Coordinate System is:
PROJCS["NAD_1983_HARN_StatePlane_Montana_FIPS_2500",
    GEOGCS["NAD83(HARN)",
        DATUM["NAD83_High_Accuracy_Reference_Network",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6152"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4152"]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",49],
    PARAMETER["standard_parallel_2",45],
    PARAMETER["latitude_of_origin",44.25],
    PARAMETER["central_meridian",-109.5],
    PARAMETER["false_easting",6458320.416666666],
    PARAMETER["false_northing",0],
    UNIT["us_survey_feet",0.3048006096012192],
    AUTHORITY["EPSG","2818"]]
Origin = (2770000.000000000000000,1300000.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  TIFFTAG_XRESOLUTION=0
  TIFFTAG_YRESOLUTION=0
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( 2770000.000, 1300000.000) (124d20'19.78"W, 46d51'16.82"N)
Lower Left  ( 2770000.000, 1290000.000) (124d19'52.69"W, 46d49'39.82"N)
Upper Right ( 2780000.000, 1300000.000) (124d17'58.38"W, 46d51'35.40"N)
Lower Right ( 2780000.000, 1290000.000) (124d17'31.35"W, 46d49'58.39"N)
Center      ( 2775000.000, 1295000.000) (124d18'55.55"W, 46d50'37.61"N)
Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue
Band 4 Block=5000x1 Type=Byte, ColorInterp=Undefined

The files are available for download at: https://hdds.usgs.gov/hdds2/pub/data/disaster/200908_Hurricane_Test/data/SATELLITE/NON_INGESTED/GDAL

The file I have been working with is mt_2770_1310.tif , but I copied two additional files there too.

Change History (7)

comment:1 Changed 5 years ago by Even Rouault

This is likely related to the changes done for http://trac.osgeo.org/gdal/ticket/3901. Perhaps you could try to define the GTIFF_LINEAR_UNITS configuration option/environment variable to BROKEN

comment:2 Changed 5 years ago by jwderos

No change with GTIFF_LINEAR_UNITS.

The other change from 1.8 is the WKT. The GeoTIFF file itself says it is using "NAD_1983_HARN_StatePlane_Montana_FIPS_2500". In GDAL 1.8, gdalinfo reports "NAD83(HARN) / Montana". This seems to be pretty much the same. However, there is a NAD_1983_HARN_StatePlane_Montana_FIPS_2500 value in esri_extra.wkt.

In 1.9 there is new logic and a new file, esri_StatePlane_extra.wkt, for the state plane calculations. The string NAD_1983_HARN_StatePlane_Montana_FIPS_2500 is in this new file and there are multiple versions for meters and feet.

The GTIFF_LINEAR_UNITS hack seems to require that the file is using a user defined projection. Is it possible that 1.8 treats this file as user-defined and applies the fix whereas 1.9 has a better understanding of the projection but then doesn't apply the fix?

comment:3 Changed 4 years ago by Kyle Shannon

Cc: Kyle Shannon added

comment:4 in reply to:  3 Changed 4 years ago by AndreJoost

Component: defaultGDAL_Raster
Milestone: 1.11.0
Version: unspecified1.10.1

comment:5 Changed 3 years ago by Jukka Rahkonen

Summary: GDAL 1.9.2 reports incorrect coordinates in GeoTIFF fileGDAL 1.9.2 reports incorrect coordinates in GeoTIFF file (NAD83 HARN+US Foot)

comment:6 Changed 3 years ago by Even Rouault

Milestone: 1.11.0

comment:7 Changed 22 months ago by Even Rouault

Milestone: 2.1.0
Resolution: fixed
Status: newclosed

trunk r31405 "GTiff: correctly take into account overriden linear units for a geotiff with a EPSG PCS code (#6210, #4954)"

Note: See TracTickets for help on using tickets.