I'm looking for an example of Python implementation of contiguity constrained clustering algorithm.

The task I want to perform is to reduce the number of administrative zones by grouping them into as homogeneous regions as possible.

Input is a bunch of shapefiles with assigned features.

Restrictions that must be met:

  • adjacency of grouped zones
  • sum of selected features (e.g. population) within newly created groups must be between selected bounds.

Good example of such algorithm, and basically what I want to achieve, is Skater used in ArcGIS tool: https://pro.arcgis.com/en/pro-app/tool-reference/spatial-statistics/spatially-constrained-multivariate-clustering.htm

Another tool is GeoDa https://geodacenter.github.io/ but there is no API available so it's not intended for automated jobs.

I've found some code performing this task however it's been written for python 2.7 and hasn't been updated since years.

  • Why not try the Python 2.7 code that you have found? – PolyGeo May 6 at 13:00

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.