View source: R/create_training_data.R
sample_points | R Documentation |
Generates a SpatVector of points in a given area.
sample_points(count, region, buffer = TRUE, radius = 15, rseed = NULL)
count |
The number of points to sample |
region |
A SpatRaster with NA cells anywhere a sampled point cannot be located |
buffer |
Should points be returned with a buffer? |
radius |
The radius of each buffer (ignored if buffer = FALSE) |
rseed |
Optional integer to seed the random sampling. This allows exact "random" results to be reproduced multiple times. If no number is given, a random number will be chosen as a seed. |
This extends terra::spatSample()
to generate the correct
number of sampled points when the sample raster has a lot of NAs.
A SpatVector of buffers.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.