[R-sig-Geo] Specifying Albers projection for the contiguous US

St John Brown st_john_brown at yahoo.com
Wed Apr 30 18:24:43 CEST 2014


Hello, 
I’m trying to use the map function from package maps to draw the contiguous United States with the projection, "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=39.8 +lon_0=-98.6 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs". 
Below is my code I have written, but I don't know what to put for X. The maps documentation says, "the default is to use a rectangular projection with the aspect ratio chosen so that longitude and latitude scales are equivalent at the center of the picture." I can't figure out how to specify this in terms of a CRS string for X. 
us = map("state", plot=FALSE, fill=TRUE, col="transparent") 
us_sp = map2SpatialPolygons(us, IDs=us$names, proj4string = CRS(X) ) #don't know what to put for X 
proj.string.alb = CRS("+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=39.8 +lon_0=-98.6 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs") 
us_sp = spTransform(us_sp, CRS=proj.string.alb) 
plot(us_sp) 
Thanks for your help!




More information about the R-sig-Geo mailing list