18/11, 2021

What it does

What it does

  • Classifies environment in classes
  • Generates points for sampling with a minimum distance between points
  • Writes them as GPX or shp

how to install it

devtools::install_github("Sustainscapes/GeoStratR")

or

remotes::install_github("Sustainscapes/GeoStratR")

Lets do some stratification

Example dataset

data(Bios)

Basic function

Select <- Stratify(Bios, LowGroup = 2, HighGroup = 10,
    Criterion = "calinski")

How it is selected

ggplot(Select$Results, aes(x = n_groups, y = calinski)) +
    geom_path() + geom_point() + theme_bw() + geom_hline(aes(yintercept = max(calinski)),
    lty = 2)

  • Criterion can be changed to SSI

Let’s get to sampling

Sampling

set.seed(2021)
Points <- Random_Stratified_Min_Dist(ClassRaster = Select$FinalStack,
                                     MinDist = 2000, # in meters
                                     n = 30,
                                     n_to_test = 100)

Results

Export

head(Points)
## Simple feature collection with 6 features and 2 fields
## Geometry type: POINT
## Dimension:     XY
## Bounding box:  xmin: 10.10417 ymin: 55.10417 xmax: 10.39583 ymax: 57.35417
## CRS:           +proj=longlat +datum=WGS84 +no_defs
## # A tibble: 6 × 3
##   ID    Class            geometry
##   <chr> <chr>         <POINT [°]>
## 1 A01   A     (10.10417 57.14583)
## 2 A02   A     (10.27083 57.35417)
## 3 A03   A     (10.35417 55.22917)
## 4 A04   A      (10.3125 55.10417)
## 5 A05   A     (10.39583 55.10417)
## 6 A06   A     (10.39583 57.35417)

Export

Export_Points(Points, name = "Selected", format = "GPX")
  • Any feature request can be added in the issues on the project repo