I want to perform spatial clustering on the polygon which contains a number of total points inside it. I would like to ask if there is any ways that the polygons can be clustered based on the total number of points inside it. Since I am new to ArcGIS and python, I seek a solution without any code.

My map is as shown below.

Polygon with points

attribute of my grid feature

The expected results look like this (each color represents a cluster).

expected results

But in my case, the cluster should be formed from the regular grids shown.

  • You need to add more details. For example a screenshot of the output you want. Also you are showing two polygon layers, why? – BERA Nov 12 '17 at 15:57
  • 1
    Have a look at the Group analysis tool for doing clustering. Also sounds like you want to initially do a count of number of points in your vector grid? If so look at the spatial join tool. – Hornbydd Nov 12 '17 at 16:13
  • I have done a count of number of points in my grids and they are in the attribute of the grids. However, error occur when I try to input the grid feature to the grouping analysis. Any ideas why? – faifai Nov 13 '17 at 14:49
  • Just saying you have an error when you give no details on how you set the tool up is not going to get any response. – Hornbydd Nov 13 '17 at 15:49

With spatial autocorrelation you can measure locations with attribute values. See Spatial Autocorrelation Definition.

Hot Spot Analysis (Getis-Ord Gi*) identifies statistically significant hot spots and cold spots using the Getis-Ord Gi* statistic.

For polygon features, feature centroids are used in distance computations.

Basic knowledge of statistics is required for.

  1. Open Hot Spot Analysis (Getis-Ord Gi*) :

    Arctoolbox =>Spatial Statistics Tools => Mapping Clusters => Hot spot Analysis(Getis-Ord Gi*)

  2. Select Polygon layer in Input Feature Class.

  3. Select "Count_" field in Input Field.
  4. Define and Output Feature Class.

For more information about clustering tools please consider this link: An overview of the Mapping Clusters toolset

  • In the context of this problem, this is somewhat nonsensical. Autocorrelation will tell you little about the clustering process in this problem. This is simply an adjacency verses value-range problem. The results of a Gi* statistic will not produce a cluster value associated with aggregating the data in the way the OP is thinking. Just because ESRI named the toolset clustering does not mean that it literally performs univariate or multivarte clustering. Ideally, if available in ArcGIS, one would just apply the k-means statistic on [X,Y] and count and play with k to obtain the desired results. – Jeffrey Evans Nov 13 '17 at 17:30
  • I should note that a LISA statistic, indicating the adjacency of low-high, high-low, low-low and high-high values, may be useful here but it is likely that, given the number of zeros, many of the values would be insignificant and thus identifying irrelevant clusters. The aggregation of the data, into arbitrary sized bins, makes the spatial process dubious at best and somewhat invalidates many statistics assumptions. This is why the collect events tool is such a bad idea, it directly introduces a MAUP/change of support problem. – Jeffrey Evans Nov 13 '17 at 17:56

This type of clustering is a bit dubious but, there is a work flow that you could follow in statistical software such as R. Sorry, there is no clear "no code" solution other than the advice that you muck with symbology to find breaks in the counts. This however, does not account for spatial clustering.

Here is a worked example illustrating why you do not want to cluster the data using just the counts.


coordinates(meuse) <- ~x+y 

First we create some polygons and random points to emulate your data.

hex <- hexagons(meuse, res=100) 
pts <- spsample(hex, n=10000, type="random")
  pts <- SpatialPointsDataFrame(pts, data.frame(ID=1:length(pts)))
pts.hex <- point.in.poly(pts, hex)
pt.count <- tapply(pts.hex$ID, pts.hex$HEXID, length)

We need to account for polygons with no points.

na.idx <- which(!rownames(hex@data) %in% names(pt.count))
  if(length(na.idx) > 0) {
    pt.count <- insert.values(pt.count, 0, na.idx)
    hex@data$count <- pt.count  
    hex@data$count <- ifelse(hex@data$count < 2, 0, hex@data$count)
  } else {
    hex@data$count <- pt.count

#plot counts
spplot(hex, "count")

Here we create k-means clusters with k=3 using both counts and coordinates to define the clusters then we plot our results.

clust <- kmeans( scale(cbind(coordinates(hex), hex@data$count)), 3 )$cluster
  hex@data$k3 <- clust
spplot(hex, "k3")

Cluster k=3 with counts and coordinates

Now we the clusters using k=3 and count only to define our clusters.

clust <- kmeans( scale(hex@data$count), 3 )$cluster
  hex@data$k3count <- clust
spplot(hex, "k3count")

Cluster k=3 with only counts

As you can see, including the spatial coordinates constrains the clustering in a way that a univariate (count only) does not thus, resulting in more spatially uniform and congruent results.

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.