[This ice cap data is the gift that just keeps giving. Today’s guest post is courtesy of Sarah Battersby – Chief Crazy Map Lady in Residence – where she explains how she weaves her dark magic.
And then she gloats. Fair enough – she earned it.]
The first step in attempting something like this is to wait for someone else to find a nice dataset for you to work with and call you out in their blog lamenting the challenges of working with polar data in a Web Mercator projected base map.
Then get to work.
The National Snow and Ice Data Center data is delivered in a polar stereographic projection. For the southern hemisphere data that I used, the projection was the NSIDC Sea Ice Polar Stereographic South. This projection takes our latitude and longitude coordinates out of angular units and puts them onto a nice, flat Cartesian plane, with the center of the projection (the South Pole) as our new 0,0 coordinate, and all locations plotted on a grid measured in meters away from the center.
Here is what that projection looks like (graphic from NSIDC)
And with this great dataset, founded on solid sea and ice data science, and represented in a carefully selected projection that is mathematically appropriate for the data…we will start doing some serious lying with data to bend it to our will.
1. Projections are just mathematical transformations from angular coordinates to planar coordinates. So, using an open source GIS (QGIS) we’ll tell our first lie: Set the coordinate system to Web Mercator. Do not re-project into Web Mercator! We just want the dataset to think it is in Web Mercator coordinates.
That essentially shifts the center of our projection from (0°, -90°) to (0°, 0°). That’s right, we just moved the south pole to a spot right off the west coast of Africa. I am already a little ashamed of myself, but, now I can show polar data in a system that uses Web Mercator.
But, there is a problem…my coordinates are still in “Web Mercator” meters. While Tableau can work with shapefiles in non-latitude and longitude coordinates if there is a projection defined for the dataset, I still wanted to force the data back into latitude and longitude, so I then reprojected (or, perhaps un-projected) back to latitude and longitude using QGIS.
2. And there is an even bigger problem – I don’t want a base map that shows Antarctica at the equator! I need a new custom base map…off to Mapbox I go. With Mapbox I can style a new set of basemap tiles starting from a blank canvas. That means I can lie about the coordinate system of all sorts of spatial files and have them show up in the same wrong location in the world! I am totally going to lose my cartographic license for this…
I grabbed a dataset with boundaries of the world countries (in latitude and longitude) -> used QGIS to project to Polar Stereographic to match the real sea ice data (to get it in the right coordinate system) -> changed the projection definition to Web Mercator (introducing the lie to make it think it was really located at the equator) -> reprojected back to latitude and longitude.
I spent way too much time searching for some imagery to bling up the base map, and eventually found a nice geotiff (tiff with geographic coordinates attached to it) from IBCSO. I jumped through the hoop of lie about the projection (it was originally the polar stereographic, just like the sea ice data) and then send back to lat/lon process.
Using Mapbox Studio I put all of the data onto a blank basemap and published it for use in Tableau.
3. Load up the new tiles in Tableau, and then lock down the pan/zoom to hide the fact that this is a polar stereographic wearing Web Mercator clothing (where did the rest of those continents go??? That’s right, I deleted them because I found them inconvenient and ugly in my map…cartographic license at work!).
4. In the battle of polar data: Sarah – 1, Alan – 0