Opened 8 months ago

Closed 5 months ago

Last modified 5 months ago

#6675 closed defect (fixed)

elevation unit for geotif files not detected correctly

Reported by: adamgeo Owned by: warmerdam
Priority: high Milestone: 2.2.0
Component: GDAL_Raster Version: unspecified
Severity: major Keywords:
Cc: adam@…

Description

Gdal always reads the elevation unit of the geotiff files as meter even if the elevation unit is in feet and causes scale up in height. Sample data is attached.

Attachments (1)

Elevation_feet.tif (676.3 KB) - added by adamgeo 8 months ago.

Download all attachments as: .zip

Change History (6)

Changed 8 months ago by adamgeo

Attachment: Elevation_feet.tif added

comment:1 Changed 8 months ago by Jukka Rahkonen

How do you use GDAL for reading the elevation?

comment:2 Changed 8 months ago by Even Rouault

If you explicitly set the GTIFF_REPORT_COMPD_CS=YES configuration option, you'll get a COMPD_CS reported with vertical units = US survey foot

$ GTIFF_REPORT_COMPD_CS=YES gdalinfo Elevation_feet.tif
Driver: GTiff/GeoTIFF
Files: Elevation_feet.tif
Size is 509, 356
Coordinate System is:
COMPD_CS["unknown",
    PROJCS["GCS_WGS_1984",
        GEOGCS["WGS 84",
            DATUM["WGS_1984",
                SPHEROID["WGS 84",6378137,298.2572235604902,
                    AUTHORITY["EPSG","7030"]],
                AUTHORITY["EPSG","6326"]],
            PRIMEM["Greenwich",0],
            UNIT["degree",0.0174532925199433],
            AUTHORITY["EPSG","4326"]],
        PROJECTION["Transverse_Mercator"],
        PARAMETER["latitude_of_origin",0],
        PARAMETER["central_meridian",-153],
        PARAMETER["scale_factor",0.9996],
        PARAMETER["false_easting",1640416.666666667],
        PARAMETER["false_northing",0],
        UNIT["US survey foot",0.3048006096012192,
            AUTHORITY["EPSG","9003"]]],
    VERT_CS["unknown",
        VERT_DATUM["unknown",2005],
        UNIT["US survey foot",0.3048006096012192,
            AUTHORITY["EPSG","9003"]],
        AXIS["Up",UP]]]
Origin = (649119.524002539925277,7223949.479605697095394)
Pixel Size = (2.457814315667396,-2.457814315667140)
Metadata:
  AREA_OR_POINT=Point
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  649119.524, 7223949.480) (155d53' 7.84"W, 19d53'22.88"N)
Lower Left  (  649119.524, 7223074.498) (155d53' 7.68"W, 19d53'14.21"N)
Upper Right (  650370.551, 7223949.480) (155d52'54.74"W, 19d53'23.09"N)
Lower Right (  650370.551, 7223074.498) (155d52'54.58"W, 19d53'14.42"N)
Center      (  649745.038, 7223511.989) (155d53' 1.21"W, 19d53'18.65"N)
Band 1 Block=509x1 Type=Float32, ColorInterp=Gray
  NoData Value=-32767

We could perhaps use that to feed that into the more easy to use GDALRasterBand::GetUnits?() interface.

comment:3 Changed 8 months ago by adamgeo

Thanks, the config option was helpful and helped a lot!

comment:4 Changed 5 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 37085:

GTiff: make GetUnitType?() use VERT_CS unit as a fallback (fixes #6675)

comment:5 Changed 5 months ago by Even Rouault

Milestone: 2.2.0
Note: See TracTickets for help on using tickets.