La traducción de GeoTIFF a ENVI GDAL provoca la rotación
Tengo un GeoTIFF ( puedes descargarlo aquí ~16 MB) que quiero convertir a ENVI raw . Estoy usando este comando GDAL:
gdal_translate -ot UInt16 -scale -of ENVI -outsize 1025 1025 dgm1_32372_5680_2_nw.tif dgm1_32372_5680_2_nw.raw
el comando funciona bien, pero da una advertencia:
Warning 1: Geotransform matrix has non rotational terms
Cuando comparo el archivo *.tif y *.raw en QGIS (3.14), el archivo *.raw se rotó de alguna manera.
Así que busqué en Google y encontré esta pregunta . Ok, echemos un vistazo:
grep "map info" dgm1_32372_5680_2_nw.hdr
da:
map info = {Transverse Mercator, 1, 1, 32371999.5, 5679999.5, 1.95121951219512, 1.95121951219512, rotation=90}
Pero según esta publicación de blog, el error se solucionó con GDAL 2.20. Estoy usando GDAL 3.0.4. Entonces, ¿alguien sabe cuál podría ser el problema?
Respuestas
Necesitas gdalwarp para arreglar la rotación:
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.