I'm attempting to create n sub-regions from a polygon based on a cluster analysis of a bunch of overlapping raster layers (physical layers, eg: depth, currents, waves).

Currently, I can create a regular grid across the polygon, then extract physical attributes from the physical raster layers (eg: Gridspot or equivalent tool) then, run a cluster analysis restricted to n number of clusters (in R or other stats package).

Then, I can identify each cluster-group, and plot them back in GIS (QGIS or ArcMap). I envisage however, that some cluster-groups will be dispersed (spatial outliers and not meaningful), whereas some will be clumped (worthy of being a sub-region).

I could then manually draw around representative clumps to create n sub-regions.

Is there a tool like ArcMap 10.1 Grouping Analysis that can be run in QGIS? I'm only running 10.0.

Are there suggestions of a better way to do cluster analysis of multiple raster layers, to create n sub-regions (bio-regions)?

  • 5
    Not sure I'm understanding the role of the polygon. If you only have a single polygon, perhaps you can just clip the rasters as a pre-process and then run your cluster analysis directly on the rasters? Presuming you'll create a multi-dimensional raster/array as input, you should get an set of cluster ids back, you can visualize this (either by displaying the raster directly or converting back to a vector representation).
    – Roland
    Commented Sep 16, 2013 at 21:07
  • 2
    Maybe take a look at clusterPy?
    – Joseph
    Commented Jan 14, 2016 at 11:01
  • 1
    @Joseph I have only put the bounty on this to try to help out gis.stackexchange.com/questions/176805/… so if you think clusterPy will help then be sure to add an answer.
    – PolyGeo
    Commented Jan 18, 2016 at 8:22
  • 1
    @PolyGeo - clusterPy may help with this post as it mainly analyses clusters in rasters. But I haven't used it myself so not sure if it will help with only clustering points.
    – Joseph
    Commented Jan 18, 2016 at 12:59
  • 1
    Have look at this post - gis.stackexchange.com/questions/159285/…
    – jbalk
    Commented Aug 25, 2016 at 6:10

1 Answer 1


It seems that your problem is that cluster analysis processes such as k-means in R do not consider spatial information, hence the output is likely to be dispersed (spatially at least!). Have you considered adding the raster row and column values in as additional variables, this would make the clustering algorithm 'aware' of the spatial configuration of the data?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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