Last data update: 2014.03.03

R: Spherical Mercator projection
crsMercR Documentation

Spherical Mercator projection

Description

Defines CRS's for the Spherical Mercator and long-lat projections.

Usage

crsMerc
crsLL

Details

CRS objects for epsg:4326 (long-lat) and the spherical Mercator projection used by web mapping services. Using epsg codes requires the rgdal package to be installed, and crsLL is intended as a replacement for CRS("+init=epsg:4326") when rgdal is not guaranteed to be available.

Value

Objects of class CRS.

References

https://en.wikipedia.org/wiki/Web_Mercator, http://spatialreference.org/ref/epsg/4326/

See Also

CRS

Examples


crsMerc
try(CRS("+init=epsg:3857"), silent=TRUE)

crsLL
try(CRS("+init=epsg:4326"), silent=TRUE)

if(require('rgdal', quietly=TRUE)){
	xOrig = SpatialPoints(cbind(-40,30), proj4string=crsLL)
	xMerc = spTransform(xOrig, crsMerc)
	xLL = spTransform(xMerc, crsLL)
	
	coordinates(xOrig)
	coordinates(xMerc)
	coordinates(xLL)
}
	

Results