Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have two raster A and B. A and B have the same grid size but different extent. How can I make A has the same number of columns and rows, as well as the spatial extent of B?

share|improve this question
add comment

3 Answers

up vote 4 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
add comment

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

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.