dgrectgrid | R Documentation |
Note: This may generate odd results for very large rectangles, because putting rectangles on spheres is weird... as you should know, if you're using this package.
dgrectgrid( dggs, minlat = -1, minlon = -1, maxlat = -1, maxlon = -1, cellsize = 0.1, savegrid = NA )
dggs |
A dggs object from dgconstruct() |
minlat |
Minimum latitude of region of interest |
minlon |
Minimum longitude of region of interest |
maxlat |
Maximum latitude of region of interest |
maxlon |
Maximum longitude of region of interest |
cellsize |
Distance, in degrees, between the sample points used to generate the grid. Small values yield long generation times while large values may omit cells. |
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) |
Returns an sf object.
If !is.na(savegrid)
, returns a filename.
library(dggridR) dggs <- dgconstruct(spacing=1000,metric=FALSE,resround='down') #Get grid cells for the conterminous United States grid <- dgrectgrid(dggs, minlat=24.7433195, minlon=-124.7844079, maxlat=49.3457868, maxlon=-66.9513812)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.