Converts a range of spatial data formats into a matrix representing the bounding box

geo_bb_matrix(shp)

Arguments

shp

Spatial object (from sf or sp packages)

See also

Other geo: bbox_scale(), geo_bb(), quadrant(), reproject()

Examples

geo_bb_matrix(routes_fast)
#>         min       max
#> x -1.550807 -1.511861
#> y 53.804098 53.828874
geo_bb_matrix(routes_fast_sf)
#>           [,1]      [,2]
#> [1,] -1.550964 -1.510987
#> [2,] 53.802478 53.830414
geo_bb_matrix(cents[1, ])
#>                 min       max
#> coords.x1 -1.546463 -1.546463
#> coords.x2 53.809517 53.809517
geo_bb_matrix(c(-2, 54))
#>      [,1] [,2]
#> [1,]   -2   -2
#> [2,]   54   54
geo_bb_matrix(sf::st_coordinates(cents_sf))
#>           [,1]      [,2]
#> [1,] -1.550806 -1.511861
#> [2,] 53.804098 53.828874