Skip to content

Instantly share code, notes, and snippets.

@hampelm
Created May 17, 2012 23:16
Show Gist options
  • Save hampelm/2722214 to your computer and use it in GitHub Desktop.
Save hampelm/2722214 to your computer and use it in GitHub Desktop.
Parcel clustering algorithm
n = maximum number of parcels that can be in a cluster
Get list of parcels to survey.
Create an empty list of clusters.
Find top-leftmost parcel.
Find up to n-1 parcels that border that parcel.
Only select parcels with the same street name.
Only select parcels that aren't already in a cluster
Put the selected parcels in the same cluster.
If there are are less than n parcels in the cluster, repeat the process
to find bordering parcels, but use the second parcel in the cluster.
(if no bordering parcels are found, what to do?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment