[gdal-dev] how to combine overlapping rasters?

Etienne Tourigny etourigny.dev at gmail.com
Tue Dec 6 16:59:44 EST 2011


Hi all.

I am trying to combine 2 overlapping rasters into a single raster.
Specifically, I have a raster for land cover types covering South
America and another one for Brazil.

I want the values from the Brazil map to overlap the values from the
South American map.
To complicate things further, the Brazil map has some holes (no data
inside the map), which I would like to be set from the South America
map.

Can this be done with gdal utilities or Gis, or do I need to write a
python script?
I thought of doing some tricks to the Brazil map and create a band
from which I could set nodata values in South America map, and
then using gdalwarp (combining the modified South America map and the
Brazil map), does that make sense?

Posted sample jpg+jpw files at
http://www.openclimgeo.org/pub/maps/

A related question: How can I effectively mask (mark as nodata) raster
pixels inside a polygon?  For example, I would like to set the pixels
of the South American map to nodata inside the political boundaries of
Brazil, from a shapefile.
This is the *reverse* of clipping a raster based on a a polygon (like
gdalwarp -cutline -crop_to_cutline  does)

Thanks,
Etienne


More information about the gdal-dev mailing list