TransWikia.com

SRTM HGT to GeoTIFF conversion using GDAL

Geographic Information Systems Asked by Alexey Gusev on April 5, 2021

I have (for example) SRTM-1 file n48e083.hgt with resolution 3601×3601.

What is right way to convert it to GeoTIFF?

gdal_translate -srcwin 0 0 3600 3600 -a_ullr 83 49 84 48 n48e083.hgt n48e083.tif

or

gdalwarp -te 83 48 84 49 -ts 3600 3600 n48e083.hgt n48e083.tif

I suppose the first is right and faster but I have some doubts.

And second question.
I wonder why gdal_translate does not copy "Unit Type" metadata value from hgt to tiff but gdal_merge does in the examples above?

UPDATE 1: gdalinfo n48e083.hgt

Driver: SRTMHGT/SRTMHGT File Format
Files: n48e083.hgt
Size is 3601, 3601
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (82.999861111111116,49.000138888888891)
Pixel Size = (0.000277777777778,-0.000277777777778)
Metadata:
  AREA_OR_POINT=Point
Corner Coordinates:
Upper Left  (  82.9998611,  49.0001389) ( 82d59'59.50"E, 49d 0' 0.50"N)
Lower Left  (  82.9998611,  47.9998611) ( 82d59'59.50"E, 47d59'59.50"N)
Upper Right (  84.0001389,  49.0001389) ( 84d 0' 0.50"E, 49d 0' 0.50"N)
Lower Right (  84.0001389,  47.9998611) ( 84d 0' 0.50"E, 47d59'59.50"N)
Center      (  83.5000000,  48.5000000) ( 83d30' 0.00"E, 48d30' 0.00"N)
Band 1 Block=3601x1 Type=Int16, ColorInterp=Undefined
  NoData Value=-32768
  Unit Type: m

UPDATE 2:

gdalwarp with "-r cubic" option:

gdalwarp -te 83 48 84 49 -ts 3600 3600 -r cubic n48e083.hgt n48e083.tif

makes tiff file which appears to be visually identical to original hgt when I compare them in QGIS.

First two methods I mentioned make TIFF files which has very light visual shift (~0.5 pixel).

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP