I am looking for a tool in QGIS 2.18 similar to the Combine tool in ArcGIS for rasters. I have four different raster layers that I would like to combine into a single raster that has values that represent the unique combinations of the source rasters. My source raster layers have 2-6 different classes. E.g. geology types 1-6, topographic position class 1-3, Aspect class 1-2. So they have values that range from 1-6. I would like to use this to stratify my study area by these unique combinations so that I can then randomly select sample sites.

This other question (Seeking tool in QGIS similar to ArcGIS Combine?) finds a solution that tells you how much of the area has different combinations, but I would like the result to be either a raster or vector layer so that I can then use it for other spatial analyses.

I can probably do it by converting them to vector layers by doing some unions and then some field calculations. But I didn't want to have to stuff around with invalid geometries that always seem to crop up when working with vectors and this seems a clunky way to go about it.

  • is r.statistics what you are looking for? unfortunately I can't test it right now – xlDias May 16 '18 at 12:50
  • 1
    Thanks I tried this but it only allows you to combine two rasters at a time and then I can't use the outputs in another r.statistics function as they are the wrong type ... float vs integer. But I ended up with a work-around. I assigned values of 1000, 2000, 3000 to my first raster, then values of 100, 200, 300 to my second raster, values of 10, 20, 30 to my third raster and then values of 1, 2, 3 to my fourth raster. I then just used Raster Calculator and added all of the rasters together. This was fine as I have a small number of rasters and a small number of categories in each. – GISQ May 18 '18 at 2:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.