get.Grid.size: Build a grid around an object of class...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/get.Grid.size.R

Description

Construct a grid that contains the shape (object of class "SpatialPolygonsDataFrame") and is spaced by a given distance.

Usage

1
get.Grid.size(shape, origin.grid, x.res = 0.05, y.res = 0.05, plot = FALSE)

Arguments

shape

Object of class "SpatialPolygonsDataFrame"

origin.grid

External grid constructed by this same function. See Details

x.res

Longitudinal separation in degrees, defaults to 0.05 degrees

y.res

Latitudinal separation in degrees, defaults to 0.05 degrees

plot

Boolean. Shows the constructed grid over the shape

Details

About the origin.grid parametre. Say there is the need to work on a nation-wide scale. For this you construct a grid over the whole shapes constituting the country, naming is extremal or external grid. Now to study in detail a given state it is recomemded to construct a smaller grid covering only state of interest and not the whole nation. Doing this it is necesary to asure that the smaller grid intersects the external grid. Providing the parametre commandorigin.grid constructs a small grid over the given shape but that overlaps exactly with the external grid commandorigin.grid. An example that illustrates the above could be:

1
2
3
4
5
6
# External grid
VE <- get.shape.state(get.shape.state()$Abb)
External.Grid <- get.Grid.size(VE, plot=F, x.res=1, y.res=1)
# Small grid over a state
NE <- get.shape.state(c("MI","NE"))
Small.Grid <- get.Grid.size(NE, External.Grid, plot=T, x.res=0.25, y.res=0.25)

Grid overlay example

Value

ncol

Number of columns of the grid

nrow

Number of rows of the grid

longs

Longitudinal position for each column of the grid

lats

Latitudinal position for each row of the grid

x.res

Longitudinal resolution used

y.res

Latitudinal resolution used

Author(s)

A.M. Sajo-Castelli

See Also

get.shape.venezuela, get.shape.state, get.shape.range.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
## Construct extremal grid for whole country
VE <- get.shape.state(get.shape.state()$Abb)
External.Grid <- get.Grid.size(VE)

## Build grid over Amazona state synchronized with External.Grid
AM <- get.shape.state("AM")
AM.Grid <- get.Grid.size(AM, origin.grid=External.Grid)

## Build grid over Amazona state
AM <- get.shape.state("AM")
AM.Grid <- get.Grid.size(AM)

## Another example:
VE = get.shape.state(get.shape.state()$Abb)
ZUFACO = get.shape.state(c('ZU','FA','CO'))
Main.grid=get.Grid.size(VE,x.res=1,y.res=1,plot=T)
sub.grid = get.Grid.size(ZUFACO,origin.grid=Main.grid, x.res=0.5,y.res=0.5,plot=TRUE)

## End(Not run)

vetools documentation built on May 2, 2019, 10:15 a.m.