Map Projections for R Shapefiles: United States

Someone contacted me recently about the map projections used in my blscrapeR package. After a bit of web searching, I couldn’t find a really good list of map projections for the continental U.S. that could be used in R. This list is as much for my own reference as anyone else, but hope you find it useful.

Here’s my list of map projections that are appropriate to map the continental U.S. in R. DISCLAIMER: I have omitted many, if you like another, comment and I’ll add to the list. The full code is below in Gist form. There are many other projections listed here, I just displayed the ones I find most useful.

The Native Map Projection
U-g-l-y, you ain’t got no alibi!

# Default projection of the map can be found by running the following on the SpatialPolyGonsDataFrame.
raster::crs(county)

# Then apply the result to the CRS() functions.
us.map

standardproj

Mercator Projection

# Mercator projection.
us.map

mercatorproj

Lambert Azimuthal Equal Area Projection

# Lambert Azimuthal Equal Area
us.mpa

lambertaproj

Lambert Conformal Conic Projection

# Lambert Conformal Conic
us.mpa

lambertconicalproj

Albers Equal Area Conic Projection

# Albers Equal Area Conic
us.mpa

albersequalareaconicproj

Full Code
Here’s the full script I used, including all of the projection arguments, shapefile and mapping data.

6 thoughts on “Map Projections for R Shapefiles: United States

  1. ISTM your code is incomplete and buggy and the maps are incorrect. Incomplete: you don’t show the use of county_dat or the actual plotting. Buggy: you used the name “us.mpa” instead of “us.map” and consequently seem to have plotted many copies of the mercator projection =:-/

  2. Thanks for the feedback. The code obviously isn’t meat to be run as a consequential script as us.map can only accept one set of parameters. I appreciate you pointing out the conflicting variable names though:)

    My purpose for this is to be a community US map projection quick reference for R, so any constructive criticism is highly appreciated.

    1. Oh, I thought the ggplot code at the end was one final plot, not the code used to plot all the maps!

      1. To be honest, I’m not much of a writer, more of a code-monkey. I’ll try to clarify the Gist, it works fine with all the required packages, on my local machine, but is untested on other boxes.

  3. I suggest anybody wanting to dabble in this area seriously take a look at USGS Professional Paper 1395 (“Map Projections, a Working Manual”) which can be downloaded from https://pubs.er.usgs.gov/publication/pp1395 as a (free) PDF file.

    (Geodetic) Mapping is a complex subject – in the US for example, there are the 50-odd State Plane systems, as well as at least a hundred or so ‘globally’ used map projections – UTM for example, most of the latter having different variants depending on where in the world you are mapping, and also, many needing/using different geodetic reference models (ellipsoids approximating to the shape of the planet Earth), of which there are maybe a couple of dozen ‘common’ ones.

    The conversion / projection functions are high-order polynomials that can be sensitive to numerical precision problems, so can be tricky to implement as well as validate. The ‘business rules’ that govern which type of projection you need to use, which values for things like coordinate origins etc., which conversion algorithm, and which ‘reference ellipsoid’ are also complex. John Schneider spent about 30 years working them all out before he penned USGS PP 1395. So, reading / using it can save you a lot of time and hair-tearing-out.

    By the way, it’s not uncommon to see digital maps that have features geographically misplaced by anything from 10m to 100m – often as a result of plotting GPS coordinates onto a map using the wrong geodetic basis – aside from the complications of geodetic mapping, there are 3 major systems with multiple variants in use for GPS, and you have to get the right one – a problem here being that there is no clean mapping between manufacturer/model and basis, even before users fiddle with the settings.

    Having said this, it is far from impossible – the application you are doing will tend to prescribe (or at least seriously limit) the range of possibilities. I’ve done this many times before and my recommendation is that you do your ‘research’ in advance and understand what you need to do, and in what order – it helps if you also understand “why” you are doing it, but Schneider’s book can be used as a cookbook if you dont want to spend that time and effort.

Leave a Reply