4

I have two 8bit unsigned integer 4-band raster images that overlap (Raster 1 and Raster 2). One of the images is slightly smaller than the other (Raster 1). How can I extend the extent of the smaller raster (Raster 1) to match the extent of the larger raster (Raster 2)? The extended area in Raster 1 should contain 0 values for all the bands. NoData values are not wanted in this case. I use ArcGIS/Spatial Analyst, QGIS and any open source tools.

enter image description here

Aaron
  • 51,658
  • 28
  • 154
  • 317

2 Answers2

1

You can use gdalwarp, such as:

gdalwarp -of GTiff -te minx miny maxx maxy input.tif output.tif

You can get the extents using:

gdalinfo reference.tif
GeoMonkey
  • 1,357
  • 11
  • 26
0

Hopefully Orfeo ToolBox is also on your list, of which Superimpose function fits smaller raster (your Raster 1) to a larger raster (your Raster 2).

(Allow me to show it in Monteverdi GUI, as I am not good at using it in QGIS processing - OTB mode).

enter image description here

There is a Fill Value option which fills the outside of smaller raster by the user defined value (coincidentally, default value is 0.0).

Kazuhito
  • 30,746
  • 5
  • 69
  • 149