Comments

Fun with Alternate Map Projections

When you create a map in Tableau, by default you're creating a map in the Web Mercator projection. At present, Web Mercator is "the de facto standard for web mapping applications", and is used by popular content providers like Google Maps, Microsoft Bing Maps, and OpenStreetMaps (which we use), among others.

Pros and Cons

Every map projection is a distortion of the truth, because it involves smashing an ellipsoid (the earth) onto a plane (the map). Something's gotta give. Map projections all have their respective pros and cons.

One distinct advantage of the Web Mercator is that all parallels (latitude) are, well, parallel, and so are the meridians (longitude), meaning that you can zoom in on an intersection in Finland and the streets will still cross at right angles.

It also has it's drawbacks, though. Take a look at Greenland:

Would it surprise you to find out that Greenland (836 K sq-mi) is less than one eighth of the surface area of South America (6.89 M sq-mi)? Web Mercator greatly exaggerates area near the poles.

What options do I have?

So what if each country's physical surface area really mattered to your story, like if you were visualizing population density or natural resources? How could you show an alternate projection for your world map with less area distortion? There's currently no setting to switch to a different projection, but with a little work, you can always make one yourself using the Polygon Marks type.

Let's consider the Robinson projection, a map projection made popular by the National Geographic Society, which used the Robinson from 1988 to 1998:

How to Make the Robinson Projection

Creating your own map projection in Tableau requires a few steps, none of which is particularly difficult. The trick is knowing how to string together each easy step to complete the job. I'll attempt to lay out the steps here:

  1. First, get the Shapefiles for countries from the Natural Earth Data 1:110m Cultural Vectors. Here is link to download the zip file.
  2. Next, convert the Shapefile .zip to a CSV using the Alteryx Tableau Shapefile to Polygon Converter (requires a free log in). Here is the CSV for the country shapes.
  3. Then, connect Tableau to this new CSV and create two calculated fields R_LAT (for Robinson Latitude) and R_LON (for Robinson Longitude) using the equations in this Word document. Make sure these two fields have no geographic role assigned (right click on each calculated field > Geographic Role > None).
  4. Create the basic Robinson projection map by doing the following:
    • Drag R_LAT to Rows and R_LON to Columns
    • Change the Marks type to Polygon
    • Drag Polygon ID and Sub Polygon ID to Detail
    • Drag Point ID to Path

    Here is what the basic Robinson map projection should look like:

  5. Draw the graticules or add a Background image to make sure the proportions are correct. In this case, I added this background image of the Robinson projection, and set the image options like this:

I added finishing touches to this dashboard by adding Continent to the Color shelf, formatting the Tooltips, and adding the Sheet to a Dashboard along with Text objects linking to an information page and the source shapefiles. Coloring by Continent isn't all that interesting, but you could follow Andrew Cheung's #MappingMonth tutorial to blend your own data and color by population density or natural resources, etc.

Visualizing the United States

Next, we'll consider an alternate map projection of the United States. If you do a Google Image search for "United States map", the majority of the results will be the Lambert conformal conic projection. It's the map American school children see hanging in their classrooms every day, and the projection USGS uses for many of its topographic maps. I won't go into great detail about this projection, but here it is juxtaposed with its Web Mercator cousin:

How to Make the Lambert conformal conic projection of the U.S.

To create this map projection, the steps are very similar to the Robinson world map above, except the latitude and longitude transformations were done in Excel. The Ohio State Geology department provides a very useful Excel spreadsheet that allows users to convert latitude and longitude to x and y coordinates of the Lambert projection. I took this spreadsheet and modified it to accommodate batch conversion of a list of lat/long pairings. The batch conversion spreadsheet is included in Step 2 below.

  1. First, get the Shapefiles for states of the US from the Natural Earth Data 1:110m Cultural Vectors. Here is link to download the zip file.
  2. Next, convert the Shapefile .zip to a CSV using the Alteryx Tableau Shapefile to Polygon Converter (requires a free log in). Here is the CSV for the state shapes.
  3. Then, use the Lambert conversion spreadsheet to generate x and y coordinates for the state polygons, and copy and paste the E and N columns into your original CSV.
  4. Connect Tableau to the CSV with the converted coordinates and create the basic Lambert projection map by doing the following:
    • Drag N to Rows and E to Columns
    • Change the Marks type to Polygon
    • Drag Polygon ID and Sub Polygon ID to Detail
    • Drag Point ID to Path

To make sure the aspect ratio of the map was correct, I added a background image of the Lambert projection and matched the borders with my map, setting Washout to 100% once I was comfortable with the match.

Summary

With a little research and some fancy coordinate transformations, you can use Tableau to draw alternate map projections. I hope this tutorial helped you understand how to create these two alternate map projections, and I hope you also walk away with the sense that you could create a different projection using these same tools and techniques.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This helps us prevent spam from internet robots.