TransWikia.com

GeoTIFF to ENVI GDAL translation causes rotation

Geographic Information Systems Asked by maaattes on September 23, 2020

I have a GeoTIFF(you can download it here ~16MB) which I want to convert to ENVI raw. I’m using this GDAL command:
gdal_translate -ot UInt16 -scale -of ENVI -outsize 1025 1025 dgm1_32372_5680_2_nw.tif dgm1_32372_5680_2_nw.raw
The command runs fine, but gives a warning:
Warning 1: Geotransform matrix has non rotational terms

When I compare the *.tif and the *.raw file in QGIS (3.14), the *.raw file got somehow rotated.
So I did some googling and found this question.
Ok, let’s have look:
grep "map info" dgm1_32372_5680_2_nw.hdr gives:
map info = {Transverse Mercator, 1, 1, 32371999.5, 5679999.5, 1.95121951219512, 1.95121951219512, rotation=90}

But according to this blog post the bug have been fixed with GDAL 2.20. I’m using GDAL 3.0.4.
So does anybody know what the problem might be?

One Answer

You need to gdalwarp to fix the rotation:

gdalwarp -of VRT dgm1_32372_5680_2_nw.tif dgm1_32372_5680_2_nw.vrt

Creating output file that is 2000P x 2000L.
Processing input file dgm1_32372_5680_2_nw.tif.

gdal_translate -ot UInt16 -scale -of ENVI -outsize 1025 1025 dgm1_32372_5680_2_nw.vrt dgm1_32372_5680_2_nw.raw

Input file size is 2000, 2000
0...10...20...30...40...50...60...70...80...90...100 - done.

Correct answer by user2856 on September 23, 2020

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