Description Usage Arguments Value Examples
This function draws a random pointlayer, with the following helper fuction st_sample
1 | basic_random_point(polygon, size = 12)
|
polygon |
polygon A Simple Feature or just a "sfc_MULTIPOLYGON" or "sfc_POLYGON" geometry. |
size |
sample size(s) requested; either total size, or a numeric vector with sample sizes for each feature geometry. When sampling polygons, the returned sampling size may differ from the requested size, as the bounding box is sampled, and sampled points intersecting the polygon are returned. |
A unit point Simple Feature with an parID column
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | df_example <- data.frame(name = c(1, 2),
from1 = c(0,20),
to1 = c(20, 40)
)
#Set coordinates, four points on each horizon
cord_example <- cord_setting(df_example, plot_width = 2)
#create a simple feature: Each line represents a horizon
#with one polygon as geometry.
sf_example <- sf_polygon(df_geom = cord_example,
df_attri = df_example)
lattri_example <- data.frame(name= c(1,2),
numberX = c(2, 5),
sd = c(1,1),
sm = c(TRUE, TRUE)
)
line_example <- line_mod(df = cord_example,
line_attri = lattri_example)
#splitting the polygon
example_profile <- split_polygon(polygon = sf_example,
line = line_example)
#build an random point layer with 80 points
poly_example1 <- basic_random_point(polygon = example_profile[2,], size = 80)
#plotting
plot(example_profile$geometry)
plot(poly_example1$geometry, add =TRUE, col = "darkblue")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.