[gdal-dev] how to combine overlapping rasters?

Etienne Tourigny etourigny.dev at gmail.com
Wed Dec 7 07:37:09 EST 2011


On Tue, Dec 6, 2011 at 8:08 PM, Brian Case <rush at winkey.org> wrote:
> Etienne
>
> if they overlap your limited to one of 2 options to mosaic
>
> gdalwarp or mapserver
>
> to get what ones are on top with gdalwarp i would imagine you would just
> need to play with the order on the command line.

Thanks you are right!

I used the top layer as the last input argument to gdalwarp, and the
result is as expected.

I had tried the opposite and only got one layer in the output (the
south american map).

>
> Brian
>
>
> On Tue, 2011-12-06 at 19:59 -0200, Etienne Tourigny wrote:
>> 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
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>


More information about the gdal-dev mailing list