sphere.convert: Convert between Cartesian Coordinates and Geographic...

Description Usage Arguments Value Examples

Description

In geospatial data analysis, it is common to consider locations on the Earth as data. These locations, usually provided by latitude and longitude, are not directly applicable for spherical data analysis. We provide two functions - sphere.geo2xyz and sphere.xyz2geo - that convert geographic coordinates in longitude/latitude into a unit-norm vector on \mathcal{S}^2, and vice versa. As a convention, latitude and longitude are represented as decimal degrees.

Usage

1
2
3

Arguments

lat

latitude (in decimal degrees).

lon

longitude (in decimal degrees).

xyz

a unit-norm vector in \mathcal{S}^{2}.

Value

transformed data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## EXAMPLE DATA WITH POPULATED US CITIES
data(cities)

## SELECT ALBUQUERQUE
geo = cities$coord[1,]
xyz = cities$cartesian[1,]

## CHECK TWO INPUT TYPES AND THEIR CONVERSIONS
sphere.geo2xyz(geo[1], geo[2])
sphere.xyz2geo(xyz)

Riemann documentation built on June 20, 2021, 5:07 p.m.