Let's say I have a set of points and I want to get an indication of their spatial distribution. That is, if all points are at one location a possible return value would be 0, whereas if all points are distributed evenly the return value would be 1.

The use case: I have two data set which cover the same area. I'm developing a tool to compare both sets with each other. I also want to include a rough indication of the point distribution to detect differences in the sets.

My program will be written in python using open source tools (so no arcgis).

  • Maybe this question will help you gis.stackexchange.com/questions/4484/… Feb 20 '14 at 11:30
  • This type of analysis can be accomplished using Ripley's K function. I am not aware of an implementation of Ripley's K in Python directly, however, you may be able to RPy to access the necessary functions in R. R's spatstat package has everything you need.
    – Aaron
    Feb 20 '14 at 13:34

You need to look into spatial point pattern analysis. Here's a course from the world expert that uses R.


I'm not aware of any Python spatial stats library, but you can easily compute things like nearest-neighbour distribution statistics for a quick assessment of whether a point pattern is clustered, completely random, or regularly spaced.

  • There is always RPy library for access to R from Python - rpy.sourceforge.net - if You want to stay in Python. Also see CrimeStat documentation - icpsr.umich.edu/CrimeStat - for many ways to analyse point data - You will get the names of the methods.
    – mrz
    Feb 20 '14 at 13:50

My suggestion is to extract the XY coordinates of your points based on whatever GIS you are using, then measure the entropy of your point distribution in a given extent. See wikipedia for details about entropy. There is a Python module (pyentropy)for advanced tools

Your Answer

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

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