[gdal-dev] gdal_rasterize -tr and -te

Hermann Peifer peifer at gmx.eu
Thu Sep 30 03:29:50 EDT 2010


Hi All,

GDAL >= 1.8.0 comes with the helpful switches -te and -tr. If the target 
extent is not specified, the extent of the output file will be the 
extent of the vector layers. This leads usually to corner coordinates 
like this:

Upper Left  ( 4923406.374, 3088693.597)
Lower Right ( 4994261.374, 3010723.597)

However, what I always need are corner coordinates which follow the 
"standard grid", which starts at 0,0 and then grows in all directions 
with the given pixel size. So in the above case and for e.g. a 100m 
raster I really want that the target extent grows to:

Upper Left  ( 4923500, 3088600)
Lower Right ( 4994200, 3010800)

There is probably no way of convincing gdal_rasterize to do the maths, 
based on the provided tr and te values?

Hermann







More information about the gdal-dev mailing list