[R-sig-Geo] Minimum bounding circle from cluster of points

Tina Cormier TinaACormier at gmail.com
Fri Jul 8 16:31:13 CEST 2016


Hi all,

Looking for help aggregating some field data subplots to the plot level
(data currently in shapefile format). I have clusters of 4 points (4
subplots = 1 plot). I'd like to create a circle around each cluster that is
the smallest circle that would encompass all 4 points. Sort of like a
convex hull, but a circle (convex hull, in this case, would give me a
triangle because of the layout of the subplots). I am familiar with (and
use frequently) the typical geo packages in R - with rgdal, sp, raster, and
maptools being my most frequent flyers. Is there a function I'm missing in
these (or some other) packages that might be able to help me out? In the
attribute table, I have a unique ID for each plot/cluster. So for each plot
ID (in this case, consisting of 4 subplots), I'd like to build a circle
around all of the subplots.

> str(pts)
Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
  ..@ data       :'data.frame': 160 obs. of  12 variables:
  .. ..$ Plot      : num [1:160] 1 1 1 1 2 2 2 2 3 3 ...
  .. ..$ Subplot   : num [1:160] 1 2 3 4 1 2 3 4 1 2 ...

I should also mention that it's not always 4 points (subplots), and they
aren't always covering the same size area on the ground, so buffering by a
constant distance isn't the answer. I have subset out 3 plots (so 12
subplots) into a test file here:
https://dl.dropboxusercontent.com/u/72421241/test_subplotsToPlots.zip

I have R version 3.3.0. I know it's customary to include code for what I've
tried, buuuut, that would be a blank canvas at this point. Googling hasn't
really been fruitful for this issue, so I thought you folks might have some
good ideas!

Thanks,
Tina

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list