Remote Sensing tips and tricks

Leafarctica: polar projections and Leaflet

I decided it was about time I made a web map using Leaflet.

To help with this, I teamed up with Orange Mug, and together we created Leafarctica.


We used a nice dataset of daily Antarctic MODIS imagery from GIBS and implemented an idea for a really simple viewer with date selector.

Why polar focussed?

Because when it comes to web mapping, all seems very simple until you want to use a projection that is not web mercator. So this added a nice, challenging component to the plan.

Here’s a walk through of the features we explored and used.

  1. We used Proj4Leaflet to add support for Antarctic Polar Stereographic (EPSG: 3031). We found this to be well documented and pretty straight forward to use.

  2. We were really impressed that Leaflet.Graticule plugin worked beautifully on this projection.

  3. Antarctica is big. So when zooming around the imagery, it’s easy to loose track of where you are. We tried to implement the Leaflet-MiniMap plugin. However, we didn’t have much success in getting this to work. We think it’s an issue with the not using straight forward web mercator, but more investigation is required.

  4. Leaflet-hash is used to retain the current map view when switching between imagery dates.

  5. map.fitBounds() wasn’t working with our polar projection, so Orange Mug had to hack a solution. You can find it here. This isn’t perfect however, because it stops any pan animation.

If you want to look more closely at this pretty simple implementation, head to the repo on GitHub.

In the meantime, I’m continuing to use this project as a way to learn and experiment with Leaflet.

Orange Mug

Thanks Orange Mug!

Spot an error raise a ticket