simplifyGolf <-
function (dg, descSearch = "golf", maxIterations = 100, rbind = TRUE) {
output <-
dg %>%
dplyr::filter(str_detect(str_to_lower(desc), str_to_lower(descSearch))) %>%
simplifyIntersects(maxIterations = maxIterations) %>%
mutate(type = st_geometry_type(geometry)) %>%
select(desc, type, geometry)
if (rbind == TRUE) {
output <-
list(
dg %>%
dplyr::filter(!str_detect(str_to_lower(desc), str_to_lower(descSearch))),
output) %>%
.bind_rows_sf()
}
return(output)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.