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 grids with same cell size, same starting position (top left) and same grid size. I want to sum the grids and create a sum grid as an result:

e.g. grid A + grid B = grid C

How can I achieve that with GDAL?

What happens, if my grids are not identical (1) in grid size (2) in starting position and (3) in cell size.

Thank you very much for the answer.

share|improve this question

I am answering my own question:

You can use Python library to achieve this.

Here all the files have to be the same dimension. I still do not know how to accomplish this if grid's are not in the same size.

share|improve this answer
Raster 'mapematics' is essentially just maths using arrays. So, you need to make your rasters (and therefore the arrays) the same size, either by expanding the extent of one or both (depending on the overlap) or cropping to the limits of the overlap. You can do that either by manipulating the rasters or their array equivalents. You must consider carefully how you will handle NoData. The easy way to do this sort of operation is use QGIS which will handle the mismatch of the grids for you. – MappaGnosis Mar 6 '13 at 8:50

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.