dgearthgrid: Return the coordinates constituting the boundary of cells for...

View source: R/dggridR.R

dgearthgridR 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)

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)

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


dggridR documentation built on Jan. 22, 2023, 1:15 a.m.