View source: R/UtilityFunctions.R
createSampleAreas | R Documentation |
Create sample polygons to help obfuscate a sensitive location when requesting data from non-secure sources. The basic idea is to create a square or circular area that can be use to request data. The desired target location (and area) will be contained within the sample area but not centered on the sample area.
createSampleAreas(
buffer = 0,
sizeMultiplier = 0,
shape = "square",
aoi = "",
minOffsetProportion = 0.1,
segments = 60
)
buffer |
Distance or list of distances added to the maximum bounding box dimension for |
sizeMultiplier |
Multiplier applied to the maximum bounding box dimensions for each |
shape |
Character string describing the shape of the sample area.
Valid values are |
aoi |
|
minOffsetProportion |
Proportion of |
segments |
Number of segments to use when generating a circular
sample areas. When using a |
Create polygons that can be used when requesting data from non-secure sources that contain the specific target location. Polygons are randomly offset from the target area centroid so there is no consistent relationship between the location of the polygon and the target area.
Units for buffer
are the same as the horizontal units for the input features
so you shouldn't use data in LON-LAT with units of degrees.
A set sample area polygons. The return type will
be the same as the aoi
type.
pt1 <- sf::st_point(c(-13540901, 5806426 + 500))
pt2 <- sf::st_point(c(-13540901 + 500, 5806426 - 500))
pt3 <- sf::st_point(c(-13540901 - 500, 5806426))
pt4 <- sf::st_point(c(-13540901 + 1000, 5806426 - 1000))
id <- c("P1", "P2", "P3", "P4")
x_sf <- sf::st_sf(data.frame(ID = id, stringsAsFactors = FALSE),
geom = sf::st_sfc(pt1, pt2, pt3, pt4),
crs = 3857)
pt_aoi <- prepareTargetData(aoi = x_sf, buffer = 75, shape = "circle")
sample_areas <- createSampleAreas(aoi = pt_aoi, buffer = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.