knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
nemo
finds the largest empty circle in the plane whose interior does not overlap with any given obstacles.
nemo
includes ony two functions :
nemo_hull
computes a concave hull from a set of points and is basically imported from package concaveman brought in R by joelgombinnemo_circle
computes the larget circle inside a hull and which doesn't include any point : its center will be the point nemoYou can install the development version from GitHub with:
``` {r eval=F}
if (!requireNamespace("remotes")) { install.packages("remotes") }
remotes::install_github("mtmx/nemo")
## Example A basic example to find the largest empty circle inside a set of points and its center aka the point nemo : ```r library(nemo) data(points) hull_pts <- nemo_hull(points = points %>% st_transform(2154), concavity =2, length_threshold = 10) nemo_pts <- nemo_circle(points = points %>% st_transform(2154), hull = hull_pts %>% st_buffer(dist=500), strict_inclusion = T, nmax_circles = 1) # mapping output library(ggplot2) ggplot() + geom_sf(data = hull_pts %>% st_buffer(dist=500) , size = 0.2) + geom_sf(data = nemo_pts , size = 1, fill=NA, color = "red") + geom_sf(data = nemo_pts %>% st_centroid() , size = 1, col = "red") + geom_sf(data=points %>% st_transform(2154))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.