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

s2_point

Create an S2 Point Vector


Description

In S2 terminology, a "point" is a 3-dimensional unit vector representation of an s2_lnglat(). Internally, all s2 objects are stored as 3-dimensional unit vectors.

Usage

s2_point(x, y, z)

as_s2_point(x, ...)

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

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

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

## S3 method for class 'matrix'
as_s2_point(x, ...)

## S3 method for class 's2_point'
as.data.frame(x, ...)

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

Arguments

x, y, z

Vectors of latitude and longitude values in degrees.

...

Unused

Value

An object with class s2_point

Examples

lnglat <- s2_lnglat(-64, 45) # Halifax, Nova Scotia!
as_s2_point(lnglat)
as.data.frame(as_s2_point(lnglat))

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.