Wolfram Language

Geo Computation

Spherical or Ellipsoidal Mercator

The Mercator projection produces different results with a spherical model of the Earth and an ellipsoidal model of the Earth. The Wolfram Language allows you to work with both situations.

The projection used in most map web servers uses a spherical model of the Earth, and it is usually called "web Mercator".

In[1]:=
Click for copyable input
webMercator = {"Mercator", "ReferenceModel" -> GeodesyData["WGS84", "SemimajorAxis"]}
Out[1]=
In[2]:=
Click for copyable input
ellipMercator = {"Mercator", "ReferenceModel" -> "WGS84"}
Out[2]=

Transform the location of the University of Oxford using both projections.

In[3]:=
Click for copyable input
p = GeoPosition[ Entity["University", "UniversityOfOxfordUnitedKingdom36022"]]
Out[3]=
In[4]:=
Click for copyable input
GeoGridPosition[p, webMercator][[1]]
Out[4]=
In[5]:=
Click for copyable input
GeoGridPosition[p, ellipMercator][[1]]
Out[5]=

There is a difference corresponding to more than 33 kilometers in the northing coordinate.

In[6]:=
Click for copyable input
GeoGridPosition[p, webMercator][[1]]; GeoGridPosition[p, ellipMercator][[1]]; %% - %
Out[6]=

Using both projections, draw respective maps of the UK and Ireland, which look nearly identical.

In[7]:=
Click for copyable input
webmap = GeoGraphics[{FaceForm[], EdgeForm[Red], Polygon[{Entity["Country", "UnitedKingdom"], Entity["Country", "Ireland"]}], Red, Point[p]}, GeoProjection -> webMercator, GeoBackground -> None][[1]]
Out[7]=
In[8]:=
Click for copyable input
ellipmap = GeoGraphics[{FaceForm[], EdgeForm[Blue], Polygon[{Entity["Country", "UnitedKingdom"], Entity["Country", "Ireland"]}], Blue, Point[p]}, GeoProjection -> ellipMercator, GeoBackground -> None][[1]]
Out[8]=

However, when overlaid on the same map, you can clearly see the difference.

In[9]:=
Click for copyable input
Show[webmap, ellipmap]
Out[9]=

Related Examples

de es fr ja ko pt-br ru zh