Thursday 14 August 2014

Web Mercator and Comparisons II

[this post has been updated]

Not a week has gone by since I posted about the problems of comparing areas between places using Web Mercator. Here's a 'simple map' (author's phrase) that allows you to compare Gaza with other places on the globe. The interactive version is here [map now corrected].

Terrific idea...take the outline of Gaza and allow people to enter a place they are familiar with in order to better understand the size of the place in comparison with somewhere they know.

Except the basemap is Google's Web Mercator (other Web Mercator basemaps do exist) and the shape has been drawn across the map. 

Only places directly on the equator contain no areal distortion on Web Mercator. Gaza lies at approximately 30 degrees North so there's already considerable distortion in the area of Gaza on Web Mercator.

If you then pan and zoom the map, the Gaza shape remains the same size and shape (at each scale) wherever you go to on the globe. It does not get reprojected as you move across the map and that's a huge cartofail fail regardless of the projection. As we saw in my previous post by looking at Tissot's Indicatrix the size of areas gets massively distorted across Web Mercator. The shape of Gaza would be no different.

Unfortunately this is not accounted for in this map. A classic case of ignoring the impact of map projections. Unless you compare Gaza with somewhere else that is exactly 30 degrees North (or South) then you're comparing one distortion with another and the relative scales of the overlay graphic and the basemap are out of sync with one another. The map, then, is utterly useless and, worse, people look at it and believe that it accurately portrays the stated aim. It doesn't.

A lot of people say to me that the science of cartography has little relevance anymore and it's all about form over function, or function over form and that rapid hackups that buck cartographic convention are healthy. If those that (a) build this sort of cartofail and (b) those that unwittingly consume it are happy then there's no hope. Unfortunately experience shows people tend to be happy in their ignorance and prefer their own facts over fact itself. If you make maps, learn some basics...it's really not that difficult but no amount of clever coding allows you to ignore the basic science of the very thing you're coding. Use your coding skills wisely and learn some domain knowledge to give those skills real power and substance.

ht to Ryan Cooper for alerting me to this map and for correctly identifying the problem.

UPDATE: Something unexpected happened after Ryan Cooper, Ralph Straumann and I tweeted and blogged about the problems of this map. The author Ahmad Nassri got in touch. I was primed for the usual volley of abuse but unlike the majority of people who seem to take offence at having a critique of their work plastered online pointing out major faults, Ahmad took the opposite view. An online conversation took place in which he was grateful for someone identifying a shortcoming and eager to learn of the cartographic 'problem', he sought help in figuring out a way to overcome it. His reaction was refreshing and a credit to his desire to get his work 'right'. Within a couple of hours he had figured out a way to control the shape of Gaza using the Google Maps API geodesic parameter so that it would draw geodesically as you pan and zoom around the globe. It doesn't get over the problems of Web Mercator but it does make his Gaza shape scaleable across the globe to work in sync with the projection. Both the map and the shape of Gaza are now distorted in the same way which is as much as can be hoped for if Web Mercator is the basemap. The map now does what it claims, it gives people the correct basis for visual comparison but most of all Ahmad illustrated a willingness to take on board our comments and correct his work. He should be hugely commended for his reaction. Win win!

1 comment:

  1. Thank you for pointing this out, I did not even realize this to be an issue in mapping tools (such as Google's) but now it makes total sense! of course!

    As it turns out (thanks to your help and Ryan's) Google Maps does in fact provide a method to adjust shapes and polygons properly as they are dragged / re-positioned: https://developers.google.com/maps/documentation/javascript/shapes#draggable

    simply by setting the property: "geodesic" on the polygon object!

    this is of such importance yet not directly made clear in the documentation and no other reference to it is mentioned in further examples on Google's site.

    I wonder how many maps out there are mis-representing data because of this.

    thanks again for pointing this out!!!

    ReplyDelete