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

Is there a GDAL command which can combine multiple rasters so that a unique output value is assigned to each unique combination of input values, like the combine command in ArcGIS?

gdal_merge seems to mosaic rasters so it is not exactly what I need.

share|improve this question

You mean something like Grass' r.cross?

share|improve this answer
Exactly! Can I do this through GDAL? – user1186 Apr 29 '13 at 0:18
You can do it with some python code. You can use itertools.product to create a list for all possible combinations, and then use the index of that list for a unique value to use in the raster. – nickves Apr 29 '13 at 1:07

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.