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

View source: R/s2region.R

s2lonlatboxR Documentation

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

Description

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

Usage

s2lonlatbox(...)

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

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

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

Arguments

...

Arguments passed on to s2, s2

radius

Numeric. Defaults to 1. For convenience this can also be an object of class "s2region" from where the radius and unitname then will be extracted.

unitname

Optional. Name of unit of length. Either a single character string, or a vector of two character strings giving the singular and plural forms, respectively.

x

object of class "s2_geography".

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)

  • s2lonlatbox(s2region): Extraction method for "s2region".

  • s2lonlatbox(default): Default method to generate "s2lonlatbox" from a longitude and latitude interval.

  • s2lonlatbox(s2_geography): Method to generate "s2lonlatbox" from an object of class "s2_geography".

See Also

s2lonlatbox.s2region s2lonlatbox.default

Examples

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) # Not implemented yet
## Very small box **not** crossing the 180th meridian
small <- s2lonlatbox(lon = c(-1, 1), lat = c(-90, 90))
# area(small) # Not implemented yet


spatstat/spatstat.sphere documentation built on Jan. 27, 2023, 2:59 a.m.