Learn R Programming

s2 (version 1.1.7)

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 default as_s2_lnglat(x, ...)

# S3 method for wk_xy as_s2_lnglat(x, ...)

# S3 method for wk_xyz as_s2_lnglat(x, ...)

Value

An object with class s2_lnglat

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

Examples

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

Run the code above in your browser using DataLab