knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE, message = FALSE )
bbox
gets bounding boxes
Various interfaces:
sp
/rgeos
, orlawn
(to be replaced with geoops
once geoops::geo_buffer
)sp
package) and spit out the bboxsf
package) data and spit out the bboxremotes::install_github("ropensci/bbox")
library("bbox")
lonlat2bbox(lon=-120, lat=45, width=10^4)
sp/rgeos class spatial objects
library(sp) x <- GridTopology(c(0,0), c(1,1), c(5,5)) sp_grid <- SpatialGrid(x) b_box(sp_grid)
WKT
wkt_poly <- "POLYGON ((100.001 0.001, 101.1235 0.0010, 101.001 1.001, 100.001 0.001))" b_box(wkt_poly)
library(leaflet) viz_bbox <- function(map, x) addRectangles(map, x[1], x[2], x[3], x[4]) leaflet() %>% addTiles() %>% viz_bbox(lonlat2bbox(lon=-120, lat=45, width=10)) %>% viz_bbox(lonlat2bbox(-120, 45, 100)) %>% viz_bbox(lonlat2bbox(-120, 45, 1000)) %>% viz_bbox(lonlat2bbox(-120, 45, 10^4)) %>% viz_bbox(lonlat2bbox(-120, 45, 10^5)) %>% viz_bbox(lonlat2bbox(-120, 45, 10^6))
bbox
in R doing citation(package = 'bbox')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.