Spatial Clustering of Point Data: Spearfish Example
This example uses the 'Partitioning Around Medoids (PAM)' algorithm (Kaufman and Rousseeuw, 2005) to divide a number of point observation into k clusters, based on their spatial attributes only. An extension of this concept can be applied to any type of geographic data, such as terrain attributes.
For a simple comparison of some of the partitioning-style clustering algorithms in R, see this page of demos. For a more complete listing of clustering approaches in R, see the Cluster Task View.
References
- Kaufman, L. & Rousseeuw, P.J. Finding Groups in Data An Introduction to Cluster Analysis Wiley-Interscience, 2005
Export xy coordinates for the bugsites from GRASS See attached file at bottom of page.
Load this text file into an R session A simple map can be made by plotting the xy coordinates.
Use the stepFlexclust function to determine an optimal number of hard classes 5 clusters looks like a good start.
Perform hard classification (clustering) with the PAM algorithm, and plot the results
Prepare the data for export to text, and save the clustered data
Load clustered data into GRASS as a new set of points called 'bclust' For each cluster, extract those points, and compute a convex hull.
Attachment:
Software
- General Purpose Programming with Scripting Languages
- LaTeX Tips and Tricks
- PostGIS: Spatially enabled Relational Database Sytem
- PROJ: forward and reverse geographic projections
- GDAL and OGR: geodata conversion and re-projection tools
- R: advanced statistical package
- GRASS GIS: raster, vector, and imagery analysis
- Generic Mapping Tools: high quality map production