get_centroid_bounding_box: Get bounding box for set of coordinate points

Description Usage Arguments Value Examples

View source: R/get_bounding_box.R

Description

Get bounding box for set of coordinate points

Usage

1
2
3
4
5
6
7
8
get_centroid_bounding_box(
  centroid,
  distance,
  lat = NULL,
  lng = NULL,
  dist.unit = c("km", "miles", "m", "ft"),
  coord.unit = c("degrees", "radians")
)

Arguments

centroid

A vector of length 2 containing latitude and longitude values.

distance

The distance from the centroid to extend the bounding box.

lat

A quoted string indicating what named value in the centroid represents latitude. If NULL, will be inferred from centroid names.

lng

A quoted string indicating what named value in the centroid represents longitude. If NULL, will be inferred from centroid names.

dist.unit

A single value representing the units the distance value is in.

coord.unit

A single value representing the units the coordinates are in.

Value

A list of length 2, containing the bottom-left (named "bl") and top-right (named "tr") coordinates of the bounding box.

Examples

1
2
3
4
5
6
get_centroid_bounding_box(c(
  "lat" = 44.121268,
  "lng" = -73.903734
),
distance = 10
)

Example output

$bl
      lat       lng 
 44.05771 -73.99212 

$tr
      lat       lng 
 44.18475 -73.81515 

spacey documentation built on March 15, 2020, 1:07 a.m.