dgearthgrid {dggridR} | R Documentation |
Return the coordinates constituting the boundary of cells for the entire Earth
Description
Note: If you have a high-resolution grid this may take a very long time to execute.
Usage
dgearthgrid(dggs, savegrid = NA, return_sf = TRUE)
Arguments
dggs |
A dggs object from dgconstruct(). |
savegrid |
If savegrid is set to a file path, then a shapefile containing the grid is written to that path and the filename is returned. No other manipulations are done. Default: NA (do not save grid, return it) |
return_sf |
logical. If |
Value
Returns an sf object.
If !is.na(savegrid)
, returns a filename.
Examples
library(dggridR)
dggs <- dgconstruct(res=20)
res <- dg_closest_res_to_spacing(dggs,spacing=1000,round='down',metric=FALSE)
dggs <- dgsetres(dggs,res)
gridfilename <- dgearthgrid(dggs,savegrid=tempfile(fileext=".shp")) #Save directly to a file
[Package dggridR version 3.1.0 Index]