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

s2_lnglat

Create an S2 LngLat Vector


Description

This class represents a latitude and longitude on the Earth's surface. Most calculations in S2 convert this to a as_s2_point(), which is a unit vector representation of this value.

Usage

s2_lnglat(lng, lat)

as_s2_lnglat(x, ...)

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

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

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

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

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

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

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

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

Arguments

lat, lng

Vectors of latitude and longitude values in degrees.

x

A s2_lnglat() vector or an object that can be coerced to one.

...

Unused

Value

An object with class s2_lnglat

Examples

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

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.