s2lonlatbox: Generic function to extract or construct a box in longitude...

Description Usage Arguments Value Methods (by class) See Also Examples

View source: R/s2region.R

Description

Generic function to extract or construct a box in longitude and latitude coordinates.

Usage

1
2
3
4
5
6
7
s2lonlatbox(...)

## S3 method for class 's2region'
s2lonlatbox(x, ...)

## Default S3 method:
s2lonlatbox(lon = c(-180, 180), lat = c(-90, 90), ...)

Arguments

...

Parameters passed to methods. For s2lonlatbox.s2region only first argument (named x) is used and the rest ignored. For s2lonlatbox.default the first two arguments (named lon and lat) are used to define the region and the rest are passed to s2() to define the radius and units of the underlying sphere.

x

Object of class "s2region".

lon

Numeric of length 2 specifying longitude interval in degrees. For boxes not crossing the 180 degree meridian the input should be such that -180 <= lon[1] < lon[2] <= 180. For boxes crossing the 180 degree meridian the input shoud be such that -180 <= lon[2] < lon[1] <= 180.

lat

Numeric of length 2 with -90 <= lat[1] < lat[2] <= 90 specifying latitude interval in degrees.

Value

Box in longitude and latitude coordinates (of class "s2lonlatbox").

Methods (by class)

See Also

s2lonlatbox.s2region s2lonlatbox.default

Examples

1
2
3
4
5
6
7
8
9
cap <- s2cap(c(1, 0, 0), h = 0.1)
s2lonlatbox(cap)
s2lonlatbox(lon = c(-30, 30), lat = c(45, 90))
## Very large box crossing the 180th meridian
big <- s2lonlatbox(lon = c(1, -1), lat = c(-90, 90))
area(big)
## Very small box **not** crossing the 180th meridian
small <- s2lonlatbox(lon = c(-1, 1), lat = c(-90, 90))
area(small)

spatstat/spatstat.sphere documentation built on July 5, 2017, 11:47 p.m.