[Gdal-dev] Resampling rasters with GDAL

Jose Luis Gomez Dans josegomez at gmx.net
Sat Jul 8 12:52:38 EDT 2006


Hi!
This is a basic question, but I am getting confused. I have a number of raster masks (integer values) that I want to apply to some other different images. To do this, I require the images to have the same extent and resolution, as well as being in the same projection. Normally, the images are bit offset due to acquisition issues, and do not cover the same extent, whereas my masks cover a larger area to be able to deal with this.

What I want to do is to produce a new raster (derived from my original masks) that can be applied in a pixel-by-pixel basis, to the images. Usually, projection is not a problem (we always use the same), and resolution is no issue. However, the extent and required resampling (using nearest neighbour) is a problem. I have tried to use gdal_translate or gdalwarp, but it is not obvious to get the target's extent for the resampling (it is in meters, not pixels). With gdalwarp, there's the "-te" option, but it doesn't produce the results I want.

Also, in some cases, the images might have an extent which is larger than that of the masks. Apart from "cutting" the excess in the images, it would be nice to avoid this step, and to produce a resampled mask with all those pixels outside the original mask's extent set to NODATA. As I understand it, GDAL cannot do this.

So what is the best way to automatically produce these masks using either the GDAL tools or the library?

Any pointers welcomed!
Thanks!
Jose
-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail



More information about the Gdal-dev mailing list