Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two raster A and B. A and B have the same grid size but different extent.

How can I make A have the same number of columns and rows, as well as the spatial extent of B?

share|improve this question
up vote 5 down vote accepted

Depending upon which platform you are using, with Arc you need to ensure, before clipping, that you set your Environment Settings: Geoprocessing>Environments... Set both Processing Extent and Raster Analysis to the extent of the layer to which you wish to clip, and set also your Cell Size to the cell size of the clip raster(not the input raster).

In QGIS use GRASS plugin thru Sextante would be the quickest way, alternatively do directly through GRASS.

Source: Advanced GIS graduate course taken last year, heaps of raster experience.

share|improve this answer

Clip raster A by B using the Clip (Data Management) tool under Data Management - Raster - Raster processing.

share|improve this answer

ArcMap Data Management Tools > Raster > Raster Processing > Clip should do it. However I found that sometimes, if the grid cells of the raster do not overlap perfectly, i.e. the two rasters are not perfectly georeferenced, Clip might retrieve a result with a slightly different number of columns and rows, generally a difference of 1. For instance, if the extent of raster A is desired to be the same as B, e.g. 20 x 20, Clip might return a raster of 20 x 21. Using the Georeferencing toolbar to perfectly georeference the images might help. Also, as Bryce Touchstone suggested, I found Geoprocessing environment is very helpful, and I also recommend filling in the Snap Raster dropdown menu with the relevant dataset.

share|improve this answer

To maintain the same cell alignment, you can use the option in "Snap Raster" in environment setting

enter image description here

share|improve this answer

If you have a single band raster, a very quick and easy approach using QGIS is simply to use the Raster Calculator, set the expression as your band of interest (e.g. BandA) and then using the 'Current layer extent' button to set the extents to a different band (e.g. BandB)enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.