Description Usage Arguments Value Examples
Create a list of bounding boxes for OpenCage queries.
1 2 3 4 5 6 7 8 9 10 |
... |
Ignored. |
xmin |
Minimum longitude (also known as |
ymin |
Minimum latitude (also known as |
xmax |
Maximum longitude (also known as |
ymax |
Maximum latitude (also known as |
data |
A |
bbox |
A |
A list of bounding boxes, each of class bbox
.
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 33 34 35 36 37 38 39 | oc_bbox(-5.63160, 51.280430, 0.278970, 51.683979)
xdf <-
data.frame(
place = c("Hamburg", "Hamburg"),
northeast_lat = c(54.0276817, 42.7397729),
northeast_lng = c(10.3252805, -78.812825),
southwest_lat = c(53.3951118, 42.7091669),
southwest_lng = c(8.1053284, -78.860521)
)
oc_bbox(
xdf,
southwest_lng,
southwest_lat,
northeast_lng,
northeast_lat
)
# create bbox list column with dplyr
library(dplyr)
xdf %>%
mutate(
bbox =
oc_bbox(
southwest_lng,
southwest_lat,
northeast_lng,
northeast_lat
)
)
# create bbox list from a simple features bbox
if (requireNamespace("sf", quietly = TRUE)) {
library(sf)
bbox <- st_bbox(c(xmin = 16.1, xmax = 16.6, ymax = 48.6, ymin = 47.9),
crs = 4326
)
oc_bbox(bbox)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.