geom_bbox | R Documentation |
Geometries bounding box (bbox). Read one or various XLSX worksheets within folder. Collect the xmin, xmax, ymin, xmax of each XLSX coordinates and creates minimum bounding box (MBR), that is, extent of geometries. This bounding box is exported as a GeoJSON file and can be copy/paste in the Map filter of EAMENA database to recover selected grid cells(list_mapping_bu.R). Can also be used to get precise Stamen basemap extent (ggmap), etc.
geom_bbox( dataDir = NA, x_column = NA, y_column = NA, wkt_column = NA, dirOut = paste0(system.file(package = "eamenaR"), "/results/"), geojson.name = "mbr.geojson", verbose = TRUE )
dataDir |
path to folder where XLSXs are. |
x_column, y_column |
column of X and Y coordinates, if these arguments are set to 'NA', the function will read the field 'wkt'. |
wkt_column |
column of WKT coordinates, if NA (default) function will read the field 'x_column' and 'y_column'. |
dirOut |
folder where GeoJSON will be saved. Default: '/results'. If it doesn't exist, will be created. |
geojson.name |
name of the GeoJSON that will be created, Default 'mbr' (minimum bound rectangle) |
verbose |
if TRUE (default) then display different messages. |
bounding box of the dataset as a GeoJSON file
geom_bbox(dataDir = "C:/Rprojects/eamena-arches-dev/data/bulk/bu/mk2/", x_column = "Longitude.", y_column = "Latitude", geojson.name = "grids_bbox_mk2.geojson") geom_bbox(dataDir = "C:/Users/Thomas Huet/Desktop/temp_xlsx/", dirOut = NA, wkt_column = "Geometric Place Expression")