Skip to content

Instantly share code, notes, and snippets.

@scw
Created April 24, 2012 23:55
Show Gist options
  • Save scw/2484727 to your computer and use it in GitHub Desktop.
Save scw/2484727 to your computer and use it in GitHub Desktop.
Behrmann projection test for R
library(rgdal)
behrmann.crs <- CRS('+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +datum=WGS84 +ellps=WGS84 +units=m +no_defs')
# define a known point in Behrmann projection
point <- SpatialPoints(cbind(0, 7284713.234), behrmann.crs)
# try reprojecting point back to WGS84
spTransform(point, CRS('+init=epsg:4326'))
# coords.x2 should be '82.85535'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment