Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as_s2_geography

Create an S2 Geography Vector


Description

Geography vectors are arrays of points, lines, polygons, and/or collections of these. Geography vectors assume coordinates are longitude and latitude on a perfect sphere.

Usage

as_s2_geography(x, ...)

## Default S3 method:
as_s2_geography(x, ...)

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

## S3 method for class 's2_lnglat'
as_s2_geography(x, ...)

## S3 method for class 's2_point'
as_s2_geography(x, ...)

## S3 method for class 'wk_wkb'
as_s2_geography(x, ..., oriented = FALSE, check = TRUE)

## S3 method for class 'WKB'
as_s2_geography(x, ..., oriented = FALSE, check = TRUE)

## S3 method for class 'blob'
as_s2_geography(x, ..., oriented = FALSE, check = TRUE)

## S3 method for class 'wk_wkt'
as_s2_geography(x, ..., oriented = FALSE, check = TRUE)

## S3 method for class 'character'
as_s2_geography(x, ..., oriented = FALSE, check = TRUE)

## S3 method for class 'logical'
as_s2_geography(x, ...)

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

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

Arguments

x

An object that can be converted to an s2_geography vector

...

Unused

oriented

TRUE if polygon ring directions are known to be correct (i.e., exterior rings are defined counter clockwise and interior rings are defined clockwise).

check

Use check = FALSE to skip error on invalid geometries

Details

The coercion function as_s2_geography() is used to wrap the input of most functions in the s2 package so that you can use other objects with an unambiguious interpretation as a geography vector. Geography vectors have a minimal vctrs implementation, so you can use these objects in tibble, dplyr, and other packages that use the vctrs framework.

Value

An object with class s2_geography

See Also

s2_geog_from_wkb(), s2_geog_from_text(), s2_geog_point(), s2_make_line(), s2_make_polygon() for other ways to create geography vectors, and s2_as_binary() and s2_as_text() for other ways to export them.


s2

Spherical Geometry Operators Using the S2 Geometry Library

v1.0.4
Apache License (== 2.0)
Authors
Dewey Dunnington [aut] (<https://orcid.org/0000-0002-9415-4582>), Edzer Pebesma [aut, cre] (<https://orcid.org/0000-0001-8049-7069>), Ege Rubak [aut], Jeroen Ooms [ctb] (configure script), Google, Inc. [cph] (Original s2geometry.io source code)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.