bounding_box | R Documentation |
Take a 2 x n matrix of lat/lon coordinates and convert them to a bounding box
bounding_box(pts)
points |
a 2 x n matrix or dataframe of lat/long coordinates in decimal degrees |
a vector of boundings points as specified by EML - A sequence of: westBoundingCoordinate, eastBoundingCoordinate, northBoundingCoordinate, southBoundingCoordinate
file_nm <- system.file(package='mdextract','ext','data_gbif_1.csv') example_points <- read.csv(file=file_nm,header=T) ex_points = matrix(c(example_points$decimalLatitude, example_points$decimalLongitude), ncol=2) ex_bb = bounding_box(ex_points) plot(ex_points[,2], ex_points[,1], xlim=c(-180, 180), ylim=c(-90, 90)) rect(ex_bb[1], ex_bb[3], ex_bb[2], ex_bb[4])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.