<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.1">Jekyll</generator><link href="https://mjmdavis.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://mjmdavis.com/" rel="alternate" type="text/html" /><updated>2022-11-28T22:11:56+00:00</updated><id>https://mjmdavis.com/feed.xml</id><title type="html">mjmdavis.com</title><subtitle>A personal webpage.</subtitle><entry><title type="html">Mercator Tiles</title><link href="https://mjmdavis.com/showing/2018/04/15/Mercator-Tiles.html" rel="alternate" type="text/html" title="Mercator Tiles" /><published>2018-04-15T08:03:39+00:00</published><updated>2018-04-15T08:03:39+00:00</updated><id>https://mjmdavis.com/showing/2018/04/15/Mercator-Tiles</id><content type="html" xml:base="https://mjmdavis.com/showing/2018/04/15/Mercator-Tiles.html"><![CDATA[<style type="text/css">
.mapwrap {
    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
}
</style>

<link rel="import" href="/assets/bower/globe-map/globe-map.html" />

<p>To help myself understand how the area of Web Mercator tiles varies across the globe, I extended my <a href="/showing/2017/05/16/how-to-read-maps.html">map visualization</a>. I find it a helpful reminder of how, despite having equivalent sizes on the mercator map, the tiles are actually far from equally sized.</p>

<globe-map width="500" projections="[&quot;Mercator&quot;, &quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;mercator_tiles&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:false}}"></globe-map>

<p>This has several implications in the realm of analytics. Web Mercator’s tiling scheme covers the majority of the globe in regular, power of 2 square tiles. It’s fantastically practical. It’s very tempting simply tile a bunch of data into WebMercator and then do analytics on it. If you do this, important not to forget that you’re failing to preserve area.</p>

<h2 id="larger-version">Larger Version</h2>

<globe-map width="740" projections="[&quot;Mercator&quot;, &quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;mercator_tiles&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}}"></globe-map>]]></content><author><name></name></author><category term="showing" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">The problem with maps readme.</title><link href="https://mjmdavis.com/documenting/2017/06/10/The-problem-with-maps-readme.html" rel="alternate" type="text/html" title="The problem with maps readme." /><published>2017-06-10T00:00:00+00:00</published><updated>2017-06-10T00:00:00+00:00</updated><id>https://mjmdavis.com/documenting/2017/06/10/The-problem-with-maps-readme</id><content type="html" xml:base="https://mjmdavis.com/documenting/2017/06/10/The-problem-with-maps-readme.html"><![CDATA[<h2 id="summary">Summary</h2>
<p>I created a <a href="/showing/2017/05/16/how-to-read-maps.html">blog post</a> around a vizualization I created to communicate how map projections distort the true earth. Often, people are unaware of how a visualization presented as a map can distort the truth. I wanted to be able to quickly get a feel for a given projection. It’s also quite interesting and fun to play with the tool.</p>

<h2 id="design">Design</h2>
<p>I wanted to ease people into the concepts and the different representations of the map. I did this by engaging in conversation with the reader. By slowly introducing more and more concepts, we explored the Mercator projection and used it as an example to explain the rationale behind the tool.</p>

<p>I created the vizualization as a web component. A web component is effectively a custom html tag that operates in isolation from the DOM. This made it easy to reproduce the maps several times across the blog post while keeping the DOM relatively clean.</p>

<p>The blog is in fact a <a href="https://jekyllrb.com/">Jekyll</a> blog  hosted on github pages. The source for the <a href="https://github.com/mjmdavis/mjmdavis.github.io">blog post</a> and the <a href="https://github.com/mjmdavis/polymer-globe">web component</a> is all available on my github account.</p>

<p>I spent some time improving the post based on feedback I received. Examples of the effect of the distortion in google maps. Simpler explanations. Improved layout and formatting. Even an AB test :D</p>

<p>The AB test was directed at these two different versions:
<a href="/showing/2017/05/16/how-to-read-maps.html">Version A</a>
<a href="/showing/2017/05/16/The-problem-with-maps.html">Version B</a></p>

<p>Despite getting about 5k views during the AB test, I was unable to get a clear result.</p>

<p>I was attempting to ‘give a man a net’ instead of ‘give a man a fish’. I want to arm people with some tools they can use to better understand how a map can distort shape and area. It is up to the reader to decide which map projection they want to use to visualise x,y or z. I hope, however, to enable them to make a more informed decision than they would otherwise.</p>

<h3 id="all-charts">All Charts</h3>
<style>
table{
    border-collapse: collapse;
    border-spacing: 0;
    border:2px solid #000000;
}

th{
    border:2px solid #000000;
}

td{
    border:1px solid #000000;
}
</style>

<table>
  <thead>
    <tr>
      <th>color</th>
      <th>information</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>black</td>
      <td>limit of the map</td>
    </tr>
    <tr>
      <td>pale green</td>
      <td>land</td>
    </tr>
    <tr>
      <td>dark green</td>
      <td>country borders</td>
    </tr>
    <tr>
      <td>red</td>
      <td>circles of constant area</td>
    </tr>
    <tr>
      <td>blue</td>
      <td>geodesic graticule</td>
    </tr>
  </tbody>
</table>

<h3 id="the-world">The World</h3>
<h4 id="chart-types">Chart Types</h4>
<p>3 Orthographic projection maps.<br />
1 Orthographic projection map with rotation enabled and a ‘recenter’ button.</p>

<h4 id="reasoning-behind-choice">Reasoning behind Choice</h4>
<p>Here I start off slowly, reminding the reader of some of the basics and introducing them to the idea of interactivity. The limitations of the Orthographic projection are highlighted along with the limitations of an interactive Orthographic projection with rotation.</p>

<h3 id="mercator-map">Mercator Map</h3>
<h4 id="chart-types-1">Chart Types</h4>
<p>1 Mercator projection map.<br />
1 Interactive Orthographic projection map alongside a static Mercator projection map.</p>

<h4 id="reasoning-behind-choice-1">Reasoning behind Choice</h4>
<p>The first ‘real’ projection that the user sees is the Mercator projections. We discuss some of the advantages and disadvantages of the Mercator projection. The reader is encouraged to use the side by side ‘globe’ and Mercator map to get an idea of the distortion.<br />
Visual encodings in the form of the area of countries are less effective due to the reader’s familiarity with seeing the world in this way. The map of the right seems normal but is apparently wrong when compared to the one on the left.</p>

<h3 id="not-tissots-indicatrix">(Not) Tissot’s indicatrix</h3>
<h4 id="chart-types-2">Chart Types</h4>
<p>1 rotateable Orthographic projection map with circles of constant area (NT Indicatrice) alongside 1 static Mercator projection map, with the same NT Indicatrice.</p>

<h4 id="reasoning-behind-choice-2">Reasoning behind Choice</h4>
<p>Here the reader is presented with the same two maps as in the previous section with the addition of a new, less familiar visual encoding. The reader is suddenly able to reason about the distortion in a different way when presented with a map covered with the familiar circle of equal area. On the left, the circles all appear to be the same size, on the right, they are distorted.</p>

<h3 id="distortion">Distortion</h3>
<h4 id="chart-types-3">Chart Types</h4>
<p>1 static Equirectangular projection map with NT Indicatrice</p>

<p>1 static Orthographic projection map,
1 static Equirectangular projection map,
1 Mercator projection map, all alongside one another.</p>

<p>2 Google Map views at the same zoom level of different latitudes of the earth. Automobiles in the frame. Additional visual encoding of scale via size comparison of everyday objects.</p>

<h4 id="reasoning-behind-choice-3">Reasoning behind Choice</h4>
<p>Here the reader gains some impression of how the Mercator projections came to be. The reader is also more generally familiarized with the concept that any 2D map of the globe is inherently distorted. Visual encodings in the form of circles of equal area accompany a progression of projections.</p>

<p>A new visual encoding is introduced in the form of familiar everyday objects. Cars. Two Google maps are presented that illustrate the distortion of the Mercator projection as the apparent size of cars at different latitudes on the earth.</p>

<h3 id="tldr">TL;DR.</h3>
<p>A simple statement. Two dimensional World Maps are inherently  distorted.</p>

<h3 id="playing-with-projections">Playing with Projections</h3>
<h4 id="chart-types-4">Chart Types</h4>
<p>1 Orthographic projection map with NT Indicatrice alongside 1 Mercator projection map, with the same NT Indicatrice. This time, both have rotation enabled and the rotation of the two projections is bound together.</p>

<p>1 Orthographic projection map with Geodesic Graticules alongside 1 Mercator projection map, with the same Geodesic Graticules. Both have rotation enabled and the rotation of the two projections is bound together. New visual encoding in the form of straight lines enclosing areas of similar area being distorted by the projection. Straight lines -&gt; curved lines as they are distorted.</p>

<p>1 Orthographic map with Geodesic Graticules above a Goode Homolosine map with the same Geodesic Graticules. Both have rotation enabled and bound.</p>

<h4 id="reasoning-behind-choice-4">Reasoning behind Choice</h4>
<p>Now that the reader is somewhat more familiar with the problem, the hand holding stops. They are introduced to two novel visual encodings that they can use to explore map distortion.</p>

<p>The first has already been seen. The circles illustrate preservation of area and independent scaling in the longitudinal and latitudinal directions. Good for evaluating whether a projection does a good job of preserving area.</p>

<p>The second encoding is made up of triangles of approximately equal area. These illustrate scaling but also the preservation of straight lines. Preservation of direction. Lines which are straight on the globe are no longer straight on the 2D map.</p>

<p>The first has already been seen. The circles illustrate preservation of area and independent scaling in the longitudinal and latitudinal directions. Good for evaluating whether a projection does a good job of preserving area.</p>

<h3 id="your-turn">Your turn</h3>
<h4 id="chart-types-5">Chart Types</h4>
<p>Default projections in the form of Orthographic and Goode Homolosine. The user is able to change the properties of the NT Indicatrice and the Geodesic Graticules. The user is also able to select the projection type from a list of different projections.</p>

<p>The user can modify the nature of the visual encodings to allow them to explore the map projection they choose.</p>

<h4 id="reasoning-behind-choice-5">Reasoning behind Choice</h4>
<p>Finally, the reader is invited to play with the tool and adjust the settings to make his own evaluations of a selection of projections.</p>

<h2 id="feedback">Feedback</h2>
<h3 id="mr-j">Mr. J</h3>
<ul>
  <li>Make the beginning of the blog post more interesting. It’s currently a bit dry.</li>
</ul>

<p>This comment led to the AB test. I tried to make the beginning of the post more exciting and to showcase some interactivity up front. In the end the test was pretty inconclusive. The null hypothesis was probably true.</p>

<h3 id="mrp">Mr.P</h3>
<ul>
  <li>It’s broken.</li>
  <li>I like the writing style. It’s easy to read.</li>
  <li>Can you show the roll, pitch, yaw of the projection.</li>
  <li>Doesn’t work on mobile.</li>
</ul>

<h3 id="msa">Ms.A</h3>
<ul>
  <li>I kind of understand it.</li>
  <li>So, the map really makes things look bigger in the north?</li>
</ul>

<h3 id="mst">Ms.T</h3>
<ul>
  <li>It’s a bit long winded.</li>
</ul>

<h3 id="feedback-summary">Feedback Summary</h3>

<p>I addressed much of the feedback but there are some things that I still feel could be improved.</p>

<p>The overall feeling that I got from the feedback was that the earlier versions weren’t interactive enough. I added interaction along the way but some users weren’t aware or didn’t get to the interactive bits before giving up.</p>

<p>I could improve the article by highlighting interactivity more obviously, encouraging more exploration of the projections and by engaging the user earlier with more exciting visuals.</p>

<p>As a learning tool, I think it’s pretty good, as a ‘viral blog post’, it needs some work :P.</p>

<h2 id="resources">Resources</h2>
<p>See end of blog post for Sources.</p>]]></content><author><name></name></author><category term="documenting" /><summary type="html"><![CDATA[Summary I created a blog post around a vizualization I created to communicate how map projections distort the true earth. Often, people are unaware of how a visualization presented as a map can distort the truth. I wanted to be able to quickly get a feel for a given projection. It’s also quite interesting and fun to play with the tool.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://mjmdavis.com/assets/polymer-globe-preview.png" /><media:content medium="image" url="https://mjmdavis.com/assets/polymer-globe-preview.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">The problem with maps.</title><link href="https://mjmdavis.com/showing/2017/05/16/The-problem-with-maps.html" rel="alternate" type="text/html" title="The problem with maps." /><published>2017-05-16T15:03:39+00:00</published><updated>2017-05-16T15:03:39+00:00</updated><id>https://mjmdavis.com/showing/2017/05/16/The-problem-with-maps</id><content type="html" xml:base="https://mjmdavis.com/showing/2017/05/16/The-problem-with-maps.html"><![CDATA[<style type="text/css">
.mapwrap {
    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
}
</style>

<link rel="import" href="/assets/bower/globe-map/globe-map.html" />

<p><a href="https://open.spotify.com/user/pingbat/playlist/3ILYt5u8hdZ1d5H1lNZSuN" target="_blank">Mandatory Accompanying Playlist</a></p>

<h2 id="tldr">TL;DR.</h2>

<p>Every map you see in 2D is some kind of tradeoff between different types of distortion. It’s not always immediately obvious what tradeoffs are being made because we have been conditioned to seeing the world as a 2D projection of a 3D object. i.e. A globe unrolled onto a piece of paper. This tool helps you explore the Mercator projection to better understand it’s distortion.</p>

<p>Try dragging either map to see how rotation changes the shape of the map.</p>

<p>For a larger version with more projections, and an explanation, read on.</p>

<globe-map width="400" projections="[&quot;Orthographic&quot;, &quot;Mercator&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;geodesic_graticule&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}}"></globe-map>

<h2 id="the-world">The World</h2>
<p>The world is round. <a href="https://www.google.com/maps/@25.6150528,3.6591736,11928591m/data=!3m1!1e3" target="_blank">Google says so</a>. The problem is, spheres can be hard to get your head around… Imagine we want to see a map of the whole world. We might try something like this.</p>

<div>
  <globe-map projections="[&quot;Orthographic&quot;]" rotation="[90,0,0]" width="600"></globe-map>
  <globe-map projections="[&quot;Orthographic&quot;]" rotation="[0,0,0]" width="600"></globe-map>
  <globe-map projections="[&quot;Orthographic&quot;]" rotation="[-90,0,0]" width="600"></globe-map>
</div>

<p>I’m not sure about you but I’m feeling distinctly underwhelmed. Only the countries in the center are undistorted and I can’t see the whole map.
People used to put this on spinning balls right?
Let’s try that.</p>

<globe-map width="1000" projections="[&quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}}"></globe-map>

<p>Fun! You can even spin it!</p>

<p>But what if we want to see two places at once? Two globes! I know what you’re thinking. You’re thinking “Genius! Who doesn’t want two hulking great spheres on their desk, or in in their pocket?! <a href="http://www.bellerbyandco.com/" target="_blank">I do!</a> While beautiful, they are a bit impractical.
They’d have to be enormous to provide the accuracy we need for sailing the high seas or finding the way around the corner to buy some milk…</p>

<p>The pragmatist in me is thinking that it would be nice if I could put this on a piece of paper.
Thin, light, you can roll it up, lay it out on a desk. Most practical!</p>

<h2 id="mercator-map">Mercator Map</h2>

<p>Someone told me about a guy that came up with ‘a popular and good’ way of making a sphere flat was something called the Mercator Projection.</p>

<globe-map width="740" height="740" projections="[&quot;Mercator&quot;]"></globe-map>

<p>The whole world is visible 🤗. Wow, Greenland looks really big though, and what’s the gigantic land mass at the bottom? Let’s put a globe next to it and work out what is going wrong.</p>

<div class="mapwrap">
  <globe-map projections="[&quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}}" width="540"></globe-map>
  <globe-map projections="[&quot;Mercator&quot;]" width="540"></globe-map>
</div>

<p>Right. See that really big land mass at the bottom? It’s not nearly as big on the globe as on the flat map. Maybe we can add some indication of scale better compare.</p>

<h2 id="not-tissots-indicatrix">(Not) Tissot’s indicatrix</h2>
<p>A Frenchman named Tissot came up with <a href="https://en.wikipedia.org/wiki/Tissot%27s_indicatrix" target="_blank">something fancy</a>. The general idea was to characterize local distortions; To show you what a small circle would look like when moved from the globe to the map.
I’m more interested in distortion at the scale of the map I’m looking at. To characterize this, I think we could draw circles on the globe and project them into our map.</p>

<div class="mapwrap">
  <globe-map projections="[&quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}" width="540"></globe-map>
  <globe-map projections="[&quot;Mercator&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}" width="540"></globe-map>
</div>

<p>Play around with the globe a bit and get a feel for how the Mercator projection distorts area. You might have noticed that the circles drawn on the poles of the globe do not appear on the Mercator map… Well, they are <em>barely</em> visible, as thin lines at the top and bottom of the map. Why aren’t they visible? Well, the Mercator projection preserves the angle of intersecting lines and preserves shapes at small scale. To do this it distorts the map.</p>

<h2 id="distortion">Distortion</h2>

<p>To better understand the Mercator projection, we should first look at the Equirectangular projection.</p>

<globe-map projections="[&quot;Equirectangular&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}" width="740"></globe-map>

<p>And how it relates to the globe and the Mercator projection.</p>

<div class="mapwrap">
  <globe-map width="300" projections="[&quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}"></globe-map>
  <globe-map width="300" projections="[&quot;Equirectangular&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}"></globe-map>
  <globe-map width="300" projections="[&quot;Mercator&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}"></globe-map>
</div>

<p>The Equirectangular projection is like dropping the spherical globe into a cylinder, making tiny holes at the poles and stretching the sphere out so the points at the poles wrap around the top and bottom of the cylinder. Then you just slice the cylinder at the <a href="https://en.wikipedia.org/wiki/180th_meridian" target="_blank">antimeridian</a> and unroll it into a rectangle.</p>

<p>Notice that on the Equirectangular map, the height of each circle is the same but the width changes as the map gets more stretched out near the poles. In fact, as you get to a pole, you have stretched a single point out into the entire width of the map!</p>

<p>To remedy the horizontal stretching, the Mercator Projection stretches the globe out in the vertical direction an equal amount. This is good because it helps preserve the shape of small objects. It’s also great if you’re a sailor as you can draw a straight line on a Merctor map and if you sail along it, you will maintain a constant heading. Really useful for navigating a ship in the 1600s. In fact, Mercator was in the business of selling maps. He described his map using this projection method as a “new and augmented description of Earth corrected for the use of sailors”. Today the Mercator projection is still used to navigate the high seas.</p>

<p>You can see the effect of this distortion when using Google Maps. If you move north or south from the equator and stay at the same zoom level, objects will become larger 😯…😮.</p>

<p>Below are embedded maps of Singapore and Anchorage, Alaska at the same zoom level. Notice how the cars in Alaska are bigger than the ones in Singapore because they’ve been stretched by the Mercator projection.</p>

<iframe width="350" height="350" src="https://www.google.com/maps/embed/v1/view?center=1.3479927,103.9684012
&amp;zoom=19
&amp;maptype=satellite
&amp;key=AIzaSyABWm9A528mgx9YlY36IeNAoN2RmcmedmM"></iframe>
<iframe width="350" height="350" src="https://www.google.com/maps/embed/v1/view?center=61.2143189,-149.8992335
&amp;zoom=19
&amp;maptype=satellite
&amp;key=AIzaSyABWm9A528mgx9YlY36IeNAoN2RmcmedmM"></iframe>
<p><br /></p>

<p>In fact, this effect leads to <a href="/showing/2017/04/29/mercator-madness.html" target="_blank">Infinite distortion</a>. Yes, the reason you couldn’t see the circle on the poles before is that they are cut off! The infinite distortion means we have an infinitely large map. Existential questions aside, we can thus reason that all Mercator maps are trimmed.</p>

<h2 id="playing-with-projections">Playing with Projections</h2>

<p>To help my understanding of how projections distort the globe I came up with a little tool that allows you to rotate a globe and see how the rotated globe translates into a particular map. Here is that tool comparing the globe to the Mercator projection. You can <strong>drag</strong> either map to rotate the earth and <strong>recenter</strong> the rotation with the button in the top left.</p>

<div class="mapwrap">
  <globe-map width="360" projections="[&quot;Orthographic&quot;, &quot;Mercator&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}"></globe-map>
</div>

<p>This representation helps gain understanding of how projections distort area. Projections also distort shape. This view better illustrates the distortion of shape.</p>

<div class="mapwrap">
  <globe-map width="360" projections="[&quot;Orthographic&quot;, &quot;Mercator&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;geodesic_graticule&quot;:{&quot;enabled&quot;:true}}"></globe-map>
</div>

<p>The idea here is to split the globe up into similarly shaped and sized tiles. Each tile has similar area and shape on the globe so it’s easy to see the distortion on the map. Traditional graticules are neither similar in size or shape on a globe and can be misleading.</p>

<p>In fact, both representations give you an idea of how a map projection distorts shape and area.</p>

<p>Armed with these weapons you can fight back against the tyrannical cartographers of times gone by. Turn your nose up in disgust at density metrics on Mercator maps, and make up your own mind as to which projection you like best.</p>

<p>My favorite is below, the <a href="https://en.wikipedia.org/wiki/Goode_homolosine_projection" target="_blank">Goode Homolosine</a>.<br />
It is indeed very Goode; as an equal-area projection, it preserves area across the map. This is good for showing distribution or density. It also, in my opinion, does a good job of minimising distortion thanks in part to it’s interruptions (cuts).</p>

<globe-map width="740" projections="[&quot;Orthographic&quot;, &quot;InterruptedHomolosine&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;geodesic_graticule&quot;:{&quot;enabled&quot;:true}}"></globe-map>

<h2 id="your-turn">Your turn</h2>

<p>Now, feel free to use this tool to play around and get a better understanding of map projections and maybe the world we live on.</p>

<globe-map width="740" projections="[&quot;Orthographic&quot;, &quot;InterruptedHomolosine&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;geodesic_graticule&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;projection_selection&quot;:{&quot;enabled&quot;:true}}"></globe-map>

<h2 id="source">Source</h2>

<p>The source for this blog can be found in my <a href="https://github.com/mjmdavis/mjmdavis.github.io" target="_blank">blog repository</a>, the spinny map thing is a polymer web component which you can reuse. It is also on GitHub in the <a href="https://github.com/mjmdavis/polymer-globe" target="_blank">polymer-globe repository</a>.</p>

<p>Credit to <a href="https://bost.ocks.org/mike/" target="_blank">Mike Bostock</a> for <a href="https://d3js.org/" target="_blank">d3</a>. Specifically for the two blocks incorporating <a href="https://bl.ocks.org/mbostock/7ea1dde508cec6d2d95306f92642bc42">Versor Dragging for Orthographic</a> and <a href="https://bl.ocks.org/mbostock/1e10b76becaa4ea4471262bcae619dae">Mercator</a> projections.</p>

<p>Credit to <a href="https://www.jasondavies.com/" target="_blank">Jason Davies</a>, specifically for his <a href="https://www.jasondavies.com/maps/rotate/" target="_blank">Versor Dragging</a> example.</p>

<p>Thanks to <a href="https://joernhees.de" target="_blank">Jörn Hees</a> for reading this several times despite having a PhD to finish.</p>]]></content><author><name></name></author><category term="showing" /><summary type="html"><![CDATA[]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://mjmdavis.com/assets/polymer-globe-preview.png" /><media:content medium="image" url="https://mjmdavis.com/assets/polymer-globe-preview.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">The problem with maps.</title><link href="https://mjmdavis.com/showing/2017/05/16/how-to-read-maps.html" rel="alternate" type="text/html" title="The problem with maps." /><published>2017-05-16T15:03:39+00:00</published><updated>2017-05-16T15:03:39+00:00</updated><id>https://mjmdavis.com/showing/2017/05/16/how-to-read-maps</id><content type="html" xml:base="https://mjmdavis.com/showing/2017/05/16/how-to-read-maps.html"><![CDATA[<style type="text/css">
.mapwrap {
    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
}
</style>

<link rel="import" href="/assets/bower/globe-map/globe-map.html" />

<p><a href="https://open.spotify.com/user/pingbat/playlist/3ILYt5u8hdZ1d5H1lNZSuN" target="_blank">Mandatory Accompanying Playlist</a></p>

<h2 id="the-world">The World</h2>
<p>The world is round. <a href="https://www.google.com/maps/@25.6150528,3.6591736,11928591m/data=!3m1!1e3" target="_blank">Google says so</a>. The problem is, spheres can be hard to get your head around… Imagine we want to see a map of the whole world. We might try something like this.</p>

<div>
  <globe-map projections="[&quot;Orthographic&quot;]" rotation="[90,0,0]" width="600"></globe-map>
  <globe-map projections="[&quot;Orthographic&quot;]" rotation="[0,0,0]" width="600"></globe-map>
  <globe-map projections="[&quot;Orthographic&quot;]" rotation="[-90,0,0]" width="600"></globe-map>
</div>

<p>I’m not sure about you but I’m feeling distinctly underwhelmed. Only the countries in the center are undistorted and I can’t see the whole map.
People used to put this on spinning balls right?
Let’s try that.</p>

<globe-map width="1000" projections="[&quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}}"></globe-map>

<p>Fun! You can even spin it!</p>

<p>But what if we want to see two places at once? Two globes! I know what you’re thinking. You’re thinking “Genius! Who doesn’t want two hulking great spheres on their desk, or in in their pocket?! <a href="http://www.bellerbyandco.com/" target="_blank">I do!</a> While beautiful, they are a bit impractical.
They’d have to be enormous to provide the accuracy we need for sailing the high seas or finding the way around the corner to buy some milk…</p>

<p>The pragmatist in me is thinking that it would be nice if I could put this on a piece of paper.
Thin, light, you can roll it up, lay it out on a desk. Most practical!</p>

<h2 id="mercator-map">Mercator Map</h2>

<p>Someone told me about a guy that came up with ‘a popular and good’ way of making a sphere flat was something called the Mercator Projection.</p>

<globe-map width="740" height="740" projections="[&quot;Mercator&quot;]"></globe-map>

<p>The whole world is visible 🤗. Wow, Greenland looks really big though, and what’s the gigantic land mass at the bottom? Let’s put a globe next to it and work out what is going wrong.</p>

<div class="mapwrap">
  <globe-map projections="[&quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}}" width="540"></globe-map>
  <globe-map projections="[&quot;Mercator&quot;]" width="540"></globe-map>
</div>

<p>Right. See that really big land mass at the bottom? It’s not nearly as big on the globe as on the flat map. Maybe we can add some indication of scale better compare.</p>

<h2 id="not-tissots-indicatrix">(Not) Tissot’s indicatrix</h2>
<p>A Frenchman named Tissot came up with <a href="https://en.wikipedia.org/wiki/Tissot%27s_indicatrix" target="_blank">something fancy</a>. The general idea was to characterize local distortions; To show you what a small circle would look like when moved from the globe to the map.
I’m more interested in distortion at the scale of the map I’m looking at. To characterize this, I think we could draw circles on the globe and project them into our map.</p>

<div class="mapwrap">
  <globe-map projections="[&quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}" width="540"></globe-map>
  <globe-map projections="[&quot;Mercator&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}" width="540"></globe-map>
</div>

<p>Play around with the globe a bit and get a feel for how the Mercator projection distorts area. You might have noticed that the circles drawn on the poles of the globe do not appear on the Mercator map… Well, they are <em>barely</em> visible, as thin lines at the top and bottom of the map. Why aren’t they visible? Well, the Mercator projection preserves the angle of intersecting lines and preserves shapes at small scale. To do this it distorts the map.</p>

<h2 id="distortion">Distortion</h2>

<p>To better understand the Mercator projection, we should first look at the Equirectangular projection.</p>

<globe-map projections="[&quot;Equirectangular&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}" width="740"></globe-map>

<p>And how it relates to the globe and the Mercator projection.</p>

<div class="mapwrap">
  <globe-map width="300" projections="[&quot;Orthographic&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}"></globe-map>
  <globe-map width="300" projections="[&quot;Equirectangular&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}"></globe-map>
  <globe-map width="300" projections="[&quot;Mercator&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}"></globe-map>
</div>

<p>The Equirectangular projection is like dropping the spherical globe into a cylinder, making tiny holes at the poles and stretching the sphere out so the points at the poles wrap around the top and bottom of the cylinder. Then you just slice the cylinder at the <a href="https://en.wikipedia.org/wiki/180th_meridian" target="_blank">antimeridian</a> and unroll it into a rectangle.</p>

<p>Notice that on the Equirectangular map, the height of each circle is the same but the width changes as the map gets more stretched out near the poles. In fact, as you get to a pole, you have stretched a single point out into the entire width of the map!</p>

<p>To remedy the horizontal stretching, the Mercator Projection stretches the globe out in the vertical direction an equal amount. This is good because it helps preserve the shape of small objects. It’s also great if you’re a sailor as you can draw a straight line on a Merctor map and if you sail along it, you will maintain a constant heading. Really useful for navigating a ship in the 1600s. In fact, Mercator was in the business of selling maps. He described his map using this projection method as a “new and augmented description of Earth corrected for the use of sailors”. Today the Mercator projection is still used to navigate the high seas.</p>

<p>You can see the effect of this distortion when using Google Maps. If you move north or south from the equator and stay at the same zoom level, objects will become larger 😯…😮.</p>

<p>Below are embedded maps of Singapore and Anchorage, Alaska at the same zoom level. Notice how the cars in Alaska are bigger than the ones in Singapore because they’ve been stretched by the Mercator projection.</p>

<iframe width="350" height="350" src="https://www.google.com/maps/embed/v1/view?center=1.3479927,103.9684012
&amp;zoom=19
&amp;maptype=satellite
&amp;key=AIzaSyABWm9A528mgx9YlY36IeNAoN2RmcmedmM"></iframe>
<iframe width="350" height="350" src="https://www.google.com/maps/embed/v1/view?center=61.2143189,-149.8992335
&amp;zoom=19
&amp;maptype=satellite
&amp;key=AIzaSyABWm9A528mgx9YlY36IeNAoN2RmcmedmM"></iframe>
<p><br /></p>

<p>In fact, this effect leads to <a href="/showing/2017/04/29/mercator-madness.html" target="_blank">Infinite distortion</a>. Yes, the reason you couldn’t see the circle on the poles before is that they are cut off! The infinite distortion means we have an infinitely large map. Existential questions aside, we can thus reason that all Mercator maps are trimmed.</p>

<h2 id="tldr">TL;DR.</h2>

<p>Every map you see in 2D is some kind of tradeoff between different types of distortion. It’s not always immediately obvious what tradeoffs are being made because we have been conditioned to seeing the world as a 2D projection of a 3D object. i.e. A globe unrolled onto a piece of paper.</p>

<h2 id="playing-with-projections">Playing with Projections</h2>

<p>To help my understanding of how projections distort the globe I came up with a little tool that allows you to rotate a globe and see how the rotated globe translates into a particular map. Here is that tool comparing the globe to the Mercator projection. You can <strong>drag</strong> either map to rotate the earth and <strong>recenter</strong> the rotation with the button in the top left.</p>

<div class="mapwrap">
  <globe-map width="360" projections="[&quot;Orthographic&quot;, &quot;Mercator&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}"></globe-map>
</div>

<p>This representation helps gain understanding of how projections distort area. Projections also distort shape. This view better illustrates the distortion of shape.</p>

<div class="mapwrap">
  <globe-map width="360" projections="[&quot;Orthographic&quot;, &quot;Mercator&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;geodesic_graticule&quot;:{&quot;enabled&quot;:true}}"></globe-map>
</div>

<p>The idea here is to split the globe up into similarly shaped and sized tiles. Each tile has similar area and shape on the globe so it’s easy to see the distortion on the map. Traditional graticules are neither similar in size or shape on a globe and can be misleading.</p>

<p>In fact, both representations give you an idea of how a map projection distorts shape and area.</p>

<p>Armed with these weapons you can fight back against the tyrannical cartographers of times gone by. Turn your nose up in disgust at density metrics on Mercator maps, and make up your own mind as to which projection you like best.</p>

<p>My favorite is below, the <a href="https://en.wikipedia.org/wiki/Goode_homolosine_projection" target="_blank">Goode Homolosine</a>.<br />
It is indeed very Goode; as an equal-area projection, it preserves area across the map. This is good for showing distribution or density. It also, in my opinion, does a good job of minimising distortion thanks in part to it’s interruptions (cuts).</p>

<globe-map width="740" projections="[&quot;Orthographic&quot;, &quot;InterruptedHomolosine&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;geodesic_graticule&quot;:{&quot;enabled&quot;:true}}"></globe-map>

<h2 id="your-turn">Your turn</h2>

<p>Now, feel free to use this tool to play around and get a better understanding of map projections and maybe the world we live on.</p>

<globe-map width="740" projections="[&quot;Orthographic&quot;, &quot;InterruptedHomolosine&quot;]" config="{&quot;rotation&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;geodesic_graticule&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true, &quot;ui_enabled&quot;:true}, &quot;projection_selection&quot;:{&quot;enabled&quot;:true}}"></globe-map>

<h2 id="source">Source</h2>

<p>The source for this blog can be found in my <a href="https://github.com/mjmdavis/mjmdavis.github.io" target="_blank">blog repository</a>, the spinny map thing is a polymer web component which you can reuse. It is also on GitHub in the <a href="https://github.com/mjmdavis/polymer-globe" target="_blank">polymer-globe repository</a>.</p>

<p>Credit to <a href="https://bost.ocks.org/mike/" target="_blank">Mike Bostock</a> for <a href="https://d3js.org/" target="_blank">d3</a>. Specifically for the two blocks incorporating <a href="https://bl.ocks.org/mbostock/7ea1dde508cec6d2d95306f92642bc42">Versor Dragging for Orthographic</a> and <a href="https://bl.ocks.org/mbostock/1e10b76becaa4ea4471262bcae619dae">Mercator</a> projections.</p>

<p>Credit to <a href="https://www.jasondavies.com/" target="_blank">Jason Davies</a>, specifically for his <a href="https://www.jasondavies.com/maps/rotate/" target="_blank">Versor Dragging</a> example.</p>

<p>Thanks to <a href="https://joernhees.de" target="_blank">Jörn Hees</a> for reading this several times despite having a PhD to finish.</p>]]></content><author><name></name></author><category term="showing" /><summary type="html"><![CDATA[]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://mjmdavis.com/assets/polymer-globe-preview.png" /><media:content medium="image" url="https://mjmdavis.com/assets/polymer-globe-preview.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Mercator Madness.</title><link href="https://mjmdavis.com/showing/2017/04/29/mercator-madness.html" rel="alternate" type="text/html" title="Mercator Madness." /><published>2017-04-29T15:03:40+00:00</published><updated>2017-04-29T15:03:40+00:00</updated><id>https://mjmdavis.com/showing/2017/04/29/mercator-madness</id><content type="html" xml:base="https://mjmdavis.com/showing/2017/04/29/mercator-madness.html"><![CDATA[<link rel="import" href="/assets/bower/globe-map/globe-map.html" />

<script src="/assets/bower/d3/d3.min.js"></script>

<script src="/assets/bower/topojson/topojson.min.js"></script>

<h1 id="mercator-madness">Mercator Madness</h1>
<h2 id="what-if-i-told-you-that-you-arent-seeing-the-whole-map">What if I told you that you aren’t seeing the whole map?</h2>

<p>Here is a Mercator map in a form you are familiar with. I have added 5˚ circles drawn on the surface of the planet. Each circle has a radius of around 555km.</p>

<globe-map projections="[&quot;Mercator&quot;]" width="800" height="800" config="{&quot;rotation&quot;:{&quot;enabled&quot;:false, &quot;ui_enabled&quot;:false}, &quot;nt_indicatrice&quot;:{&quot;enabled&quot;:true}}"></globe-map>

<p>Here is a slightly different looking Mercator map. The only difference with the one above is that I have trimmed less of the top and bottom of the map off. On this one I have drawn 0.1˚ circles. Each of these circles has a radius of about 11km.</p>

<p>This helps to illustrate the infinite nature of the Mercator projection. The red areas at the top and bottom are in fact the same red circles as on the rest of the map but drawn over the poles. They are streteched out to infinite proportions by the Mercator projection.</p>

<p>All the circles on each respective map have the same radius and the same area on the spherical earth.</p>

<canvas id="mercator-madness-canvas"></canvas>
<script src="/scratch/mercator_madness.js">
</script>]]></content><author><name></name></author><category term="showing" /><summary type="html"><![CDATA[]]></summary></entry></feed>