# example data
data(kentsamples)
p <- kentsamples$dateline_m
# plotting
plot(NULL, NULL, xlim=c(-180, 180), ylim=c(-90,90), xlab="", ylab="")
points(p, pch=3, col="red")
# basic spherical hull definition (native)
cc <- shull(p, method="centroidcircle")
plot(cc, add=TRUE)
# spherical hull area calculation
shullarea(cc)
# basic hull definition (icosahedral grid)
hex <- icosa::hexagrid(spacing=8, sf=TRUE)
# dropping hull container
cc_hex <- shull(p, s=hex, method="centroidcircle")
plot(hex, cc_hex, col="#0000DD33", border="#FFFFFF77", add=TRUE)
# with shull container
cc_hex2 <- shull(p, s=hex, method="centroidcircle", drop=FALSE)
shullarea(cc_hex2, s=hex, metric="prop")
Run the code above in your browser using DataLab