point2Frame | R Documentation |
Get the Halton Boxes around a point resource ordered by BAS Master Sample. If you pass discrete points to this function it will return how the Halton frame is represented and what the ordering is.
point2Frame(pts, bb = NULL, base = c(2, 3), J = NULL, size = 100)
pts |
Shape file as a polygon (sp or sf) to generate the boxes for. |
bb |
Bounding box which defines the Master Sample. Default is BC Marine Master Sample. |
base |
Co-prime base of Halton sequence |
J |
Definition for the number of grid cells of Halton frame. |
size |
Physical target size of Halton boxes (square ish) if J is NULL. |
## Not run: library(bcmaps) # If you haven't already installed this: install.packages('bcmapsdata', repos='https://bcgov.github.io/drat/') library(bcmapsdata) cities <- get_layer("bc_cities") bb <- buildMS(hydro, d = 2, FALSE) # For visibility will make boxes 10 km cities.halton <- point2Frame(pts = cities, bb = bb, size = 10000) plot(st_geometry(cities), pch = 20, cex = 0.1) plot(st_geometry(cities.halton), add= TRUE) #What is the actual area of a Halton box? st_area(cities.halton[1,])/1000^2 ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.