crop_shoreline: Crop shorelines

Description Usage Arguments Value Examples

Description

Crop shorelines, dealing with crossing of the date line, and return a data.frame

Usage

1
crop_shoreline(x, w = -180, e = 180, s = -90, n = 90)

Arguments

x

shoreline data, output by read_shoreline.

w, e, s, n

coordinates of the region to crop.

Value

The shorelines as a data.frame, with columns lon and lat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# NB: read a very reduced version of the data, for tests
shorepath <- system.file("extdata", ".", package="shoreliner")
w <- read_shoreline("c", 1, path=shorepath)
plot(w, max.plot=1)

head(crop_shoreline(w, -50, 50, -50, 50))

plot(crop_shoreline(w), type="l")
plot(crop_shoreline(w, -50, 50, -50, 50), type="l")
plot(crop_shoreline(w, -170, 170, -50, 50), type="l")
plot(crop_shoreline(w, 140, 290, -50, 0), type="l")
plot(crop_shoreline(w, -200, -140, 40, 90), type="l")
## Not run: 
ggplot(crop_shoreline(w, 140, 290, -50, 0)) +
  geom_polygon(aes(lon, lat)) + coord_map()

## End(Not run)

jiho/shoreliner documentation built on May 21, 2019, 1:43 a.m.