apply_grtsdb.Rd
Applies grtsdb::extract_sample
from inbo/GRTSdb to a custom perimeter. This function installs
GRTSdb if it is missing from your machine.
apply_grtsdb(perimeter, cellsize = 100, n = 20, export_path = ".", seed)
a simple features (sf) object
an optional integer. The size of each cell. Either a single value or one value for each dimension. Passed onto extract_sample from GRTSdb. Default is 100.
an optional integer. the sample size. Passed onto extract_sample from GRTSdb. Default is 20
an optional character string pointing to the path where the GRTSdb.sqlite is created. Default is "."
a optional character. Allowing to rerun a previous use.
A function to apply grtsdb to a custom perimeter
GRTSdb is automatically installed when missing from your system.
Other spatial:
CRS_extracter()
,
calculate_polygon_centroid()
,
collect_osm_features()
if (FALSE) { # \dontrun{
# Preparation
perimeter <- sf::st_as_sf(boswachterijen$boswachterijen_2024) %>%
dplyr::filter(Regio == "Taxandria",
Naam == "vacant 4")
# A new sample
sample <- apply_grtsdb(perimeter,
cellsize = 1000,
n = 20,
export_path = ".")
leaflet::leaflet() %>%
leaflet::addTiles() %>%
leaflet::addCircles(data = sample$samples,
color = "red") %>%
leaflet::addPolylines(data = sample$grid,
color = "blue") %>%
leaflet::addPolylines(data = perimeter,
color = "black")
# Reuse a old sample
seed <- sample$seed
sample <- apply_grtsdb(perimeter,
cellsize = 1000,
n = 20,
export_path = ".",
seed = seed)
leaflet::leaflet() %>%
leaflet::addTiles() %>%
leaflet::addCircles(data = sample$samples,
color = "red") %>%
leaflet::addPolylines(data = sample$grid,
color = "blue") %>%
leaflet::addPolylines(data = perimeter,
color = "black")
} # }