[Gdal-dev] gdal_translate for reframing?

Frederic Claudel frederic.claudel at magellium.fr
Fri Sep 1 04:05:28 EDT 2006


Hi all,
I'm considering reframing an image with a "NoData" edge, which can also be
seen as a translation of the image (using an integer shift).
That would allow aligning GDAL native blocks together for faster access,
when using GDALRasterBand::ReadBlock()

I've tried experimenting with GDAL command line utilities, but so far the
only way do do it is:
- add a GeoTransform to my file
- use gdalwarp to change frame
This is not a direct way, and sometimes I lose a pixel in the process (maybe
because of nearest neighbour resampling).

I was hoping that gdal_translate could do it, but the -srcwin option only
accepts boundaries that fall within the input image's extent, so I cannot
extend the image frame.
Hacking with the source to remove that lock didn' lead me anywhere - the
resulting images were destroyed, and I got a few warnings from GDAL.

Has someone wrote a command line tool to do it? Do you think it's possible
to extend gdal_translate -srcwin ?

Thanks,
Frederic Claudel





More information about the Gdal-dev mailing list