Quantcast
Channel: Question and Answer » gdal
Viewing all articles
Browse latest Browse all 397

convert GTiff to AAIGrid results in cell size switch

$
0
0

I don’t have a clue why the conversion of a tif to an asc has that kind of behavior:

original tif metadata

Size is 466, 427
Coordinate System is:
PROJCS["ETRS89_UTM_zone_32N",
...
Origin = (-1181164.876702783396468,4539238.589259737171233)
Pixel Size = (6486.620049172968720,7717.850831012333401)
...

It’s hacky to convert it into a Ascii Grid because a VRT is needed

$ gdalwarp -srcnodata -1 -dstnodata -1 -of vrt grid_tif.tif junk.vrt
$ gdal_translate -of AAIGrid junk.vrt grid_asc.asc

The resulting Ascii Grid has that metadata

Size is 427, 466
Coordinate System is:
PROJCS["ETRS89_UTM_zone_32N",
...
Origin = (-1181164.876702783396468,7834760.894102003425360)
Pixel Size = (7075.195267921446430,-7075.195267921446430)
...

BTW: the original tif is created over gdal_grid of a point shapefile in UTM32N

gdal_grid -of GTiff -zfield value -l data_points -outsize 466 427 -a "average:nodata=-1" data_points.shp grid_tif.tif

Thanks for every hint!
tee

EDIT
I uploaded the tif file
https://dl.dropboxusercontent.com/u/47812265/grid_tif.tif


Viewing all articles
Browse latest Browse all 397

Trending Articles