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

mercator

Mercator projection


Description

Transform longitude/latiude points to the Mercator projection. The main purpose of this function is to compute centroids, and to illustrate rhumb lines in the vignette.

Usage

mercator(p, inverse=FALSE, r=6378137)

Arguments

p

longitude/latitude of point(s). Can be a vector of two numbers, a matrix of 2 columns (first one is longitude, second is latitude) or a SpatialPoints* object

inverse

Logical. If TRUE, do the inverse projection (from Mercator to longitude/latitude

r

Numeric. Radius of the earth; default = 6378137 m

Value

matrix

Author(s)

Robert Hijmans

Examples

a = mercator(c(5,52))
a
mercator(a, inverse=TRUE)

geosphere

Spherical Trigonometry

v1.5-10
GPL (>= 3)
Authors
Robert J. Hijmans [cre, aut], Ed Williams [ctb], Chris Vennes [ctb]
Initial release
2019-05-25

We don't support your browser anymore

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