Learn R Programming

hero (version 0.4.7)

enlarge: Enlarge spatial domain

Description

Enlarge the spatial domain of a SpatialPolygons-class object. If width isn't specified, then 10% of the maximum distance between the points specified by sp::bbox(x) is used. The gBuffer function is used to enlarge x.

Usage

enlarge(x, width, ...)

Value

An object of class hero_enlarge. This is simply a list with eborder (the enlarged border), border (the border of the original coordinates), and the width of the englargement.

eborder and border are

SpatialPolygons-class objects.

Arguments

x

A SpatialPolygons-class object defining the border(s) of the spatial domain.

width

The width to enlarge the study area. Distance from original geometry to include in the new geometry. Negative values are allowed.

...

Additional arguments to pass to gBuffer.

Author

Joshua French

Examples

Run this code
# enlarge regular grid
# create x and y defining square border
x = seq(min(lon), max(lon), length = 60)
y = seq(min(lat), max(lat), length = 80)
border = border.grid(x, y)
e = enlarge(border)
plot(e)

# create x and y defininging an irregular grid
border2 = border.grid(lon, lat)
e2 = enlarge(border2)
plot(e2)

Run the code above in your browser using DataLab