Tech

Mercator, Mercator, Mer-what? (With a bonus conversion tool)

by
published on

A tale of Mapping Projections, LeafletJS, WMS, and Dragons. Well... Not Dragons.

I work for a weather forecasting company. A *good* way of representing 3D weather data is using maps. I do lots of work with maps. I don't know much about maps.

We use something called WMS (Web Map Service) - You may have heard of it, especially if you found yourself here in a frantic online search of "Just make this work! 😫", along with various other bits of tech and raw data. Making them play nicely is the painful interesting part.

After a day's wrestling with terms like CRS, SRS, WGS84, EPSG, and more - I've sythesized my learnings into a list, and a nice, simple coordinate converter. I hope these things are helpful to anyone else who is lost in an endless spiral of terminology, bad naming conventions names, and utter ridiculousness.

  • CRS === Coordinate Reference System
  • SRS === Spatial Reference System
  • WGS === World Geodetic System
  • CRS:84 is a WMSism which means standard WGS84 (EPSG:4326)
  • WGS84 is the latest WGS (1984), Which is a CRS
  • EPSG:XXXXXX Is a way of mapping Numbers to Physical Locations (CRS)
  • All of the variations on Mercator Projection are based upon WGS84
  • EPSG:4326 is standard Mercator (Takes into account the earth's spherical imperfections), Used in Google *Earth*
  • EPSG:3857 is, for all intents and purposes the same as EPSG:900913, EPSG:3785, ESRI:102100, and more (http://wiki.openstreetmap.org/wiki/EPSG:3857).
  • EPSG:3857 et al, are known as Google Mercator/Web Mercator, which is a Spherical Mercator projection (faster than EPSG:4326, but less acurate)
  • EPSG.io is really handy for getting your head around the numbers (Coords / Degrees / Meters) of each different EPSG
  • Industry standard for converting between EPSGs is Proj4 (http://proj4.org/) It's been re-written in various languages.
  • LeafletJS' default projection is EPSG:3857 (Google Mercator), it has 3395, and 4326 (Standard Mercator) built in too.
  • WMS Seems to prefer EPSG:900913 over EPSG:3857, Leaflet Prefers EPSG:3857. They mean the same thing, but are different names
  • Conversion between x/y values is relatively easy with EPSG.io

N.B. I don't actually know anything about cartography, maps, or maths. Various things may well be incorrect, but this knowledge helped me enough to meet our requirements.
If you have a correction for me, please let me know on Twitter: @jreeve0


Conversion Tool