Equirectangular Projection

Author

Eric W. Weisstein
March 2, 2015

This notebook downloaded from http://mathworld.wolfram.com/notebooks/MapProjections/EquirectangularProjection.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/EquirectangularProjection.html.

©2015 Wolfram Research, Inc. except for portions noted otherwise

Additional Authors

Modern Mathematica implementation by
Jose Martin-Garcia
February 28, 2015

Manipulate by
Gerli Jogeva
March 2, 2015

Projection

V5

Show[Graphics[ProjectionPlot[Projection[EquirectangularProjection[0,0]]]],
AspectRatio->Automatic,ImageSize->500]

V6

Graphics[MapProjectionPlot[MapProjection[Equirectangular[0,0]]]]

"EquirectangularProjection"->,

V10

From Jose
Feb 28, 2015

Parameters of the Earth’s ellipsoid:

a=QuantityMagnitude[GeodesyData["ITRF00","SemimajorAxis"],"Meters"];
b=QuantityMagnitude[GeodesyData["ITRF00","SemiminorAxis"],"Meters"];

First, construct the globe:

bordersLatLon=First@CountryData["World","Polygon"];
bordersXYZ=First@GeoPositionXYZ[bordersLatLon];

parallelsLatLon=GeoPosition[Outer[List,Range[-75,75,15],Range[-180,180,3]]];
parallelsXYZ=First@GeoPositionXYZ[parallelsLatLon];

meridiansLatLon=GeoPosition[Outer[List,Range[-75,75,3],Range[-180,180,30]]];
meridiansXYZ=First@GeoPositionXYZ[meridiansLatLon];

globe=Graphics3D[{Ellipsoid[{0,0,0},{a,b,b}],Line[bordersXYZ],GrayLevel[0.7],Line[parallelsXYZ],Line[Transpose[meridiansXYZ]]},Boxed->False,Lighting->"Neutral",Method->{"ShrinkWrap"->True}]

This projects on a cylinder of radius r:

OnCylinder[ens_?MatrixQ,r_]:=With[{p=Transpose[ens]},
Transpose[{r Cos[p[[1]]/r],r Sin[p[[1]]/r],p[[2]]}]
];
OnCylinder[ens_List,r_]:=OnCylinder[#,r]&/@ens;

The “Equirectangular” projection:

proj={"Equirectangular","ReferenceModel"->a};

bordersMap=First@GeoGridPosition[bordersLatLon,proj];
meridiansMap=First@GeoGridPosition[meridiansLatLon,proj];
parallelsMap=First@GeoGridPosition[parallelsLatLon,proj];

Graphics[{Red,Line[bordersMap],Opacity[0.2],Line[parallelsMap],Line[Transpose[meridiansMap]]}]

bordersCyl=OnCylinder[bordersMap,a];
parallelsCyl=OnCylinder[parallelsMap,a];
meridiansCyl=OnCylinder[meridiansMap,a];

Graphics3D[{
Ellipsoid[{0,0,0},{a,b,b}],
Line[bordersXYZ],
GrayLevel[0.7],Line[parallelsXYZ],Line[Transpose[meridiansXYZ]],
Red,Line[bordersCyl],
Opacity[0.2],Line[parallelsCyl],Line[Transpose[meridiansCyl]]
},Boxed->False,Lighting->"Neutral",PlotRange->2a{{-1,1},{-1,1},{-1,1}},Method->{"ShrinkWrap"->True},ImageSize->200]

Manipulate

Gerli Jogeva
March 2, 2015

a=QuantityMagnitude[GeodesyData["ITRF00","SemimajorAxis"],"Meters"]

b=QuantityMagnitude[GeodesyData["ITRF00","SemiminorAxis"],"Meters"]

bordersLatLon=First@CountryData["World","Polygon"];

parallelsLatLon=GeoPosition[Outer[List,Range[-90,90,15],Range[-180,180,3]]];

meridiansLatLon=GeoPosition[Outer[List,Range[-90,90,3],Range[-180,180,30]]];

whiteGlobe=
With[{
bordersXYZ=First@GeoPositionXYZ[bordersLatLon],
parallelsXYZ=First@GeoPositionXYZ[parallelsLatLon],
meridiansXYZ=First@GeoPositionXYZ[meridiansLatLon]
},
Graphics3D[{
Ellipsoid[{0,0,0},{a,b,b}],
Rotate[
{Line[bordersXYZ],
GrayLevel[0.7],
Line[parallelsXYZ],
Line[Transpose[meridiansXYZ]]},
-90Degree,
{0,0,1}]},Boxed->False,
Axes->False,
Lighting->"Neutral"
]
];

With[{
proj={"Equirectangular","ReferenceModel"->a}},
With[{
bordersMap=First@GeoGridPosition[bordersLatLon,proj],
meridiansMap=First@GeoGridPosition[meridiansLatLon,proj],
parallelsMap=First@GeoGridPosition[parallelsLatLon,proj],
num=12},With[{mapTexture=Graphics[{Red,Line[bordersMap],Opacity[0.4],Line[parallelsMap],Line[Transpose[meridiansMap]]},
PlotRangePadding->None,ImageSize->Large],
θ=Pi/num},
Manipulate[
Show[
If[showGlobe,
whiteGlobe,
{}],
If[showCylinder,
ParametricPlot3D[
(* a, b set cylinder to scale with the world,
   1.03 makes it slightly larger so that undersampling is less noticeable *)
{1.03*a*2 Sin[θ/2] Sin[j*ϕ/2] Cos[j*ϕ/2]/Sin[ϕ/2],1.03*b*(2 Sin[θ/2] Sin[j*ϕ/2] Sin[j*ϕ/2]/Sin[ϕ/2]-1),
b*z},
{j,-num,num},{z,-1,1},
PlotStyle->Directive[Opacity[0.7],White,Texture[mapTexture]],
TextureCoordinateFunction->({#4,#3}&),
Mesh->None,
Axes->False,
Boxed->False,
ViewPoint->{0,-2,-0.5},
MaxRecursion->2,
(* the following doesn't seem to have any effect *)
PerformanceGoal->ControlActive["Speed","Quality"]
],
{}
],
Lighting->"Neutral"
],
{{showGlobe,True,"Show globe"},{True,False}},
{{showCylinder,False,"Show projection"},{True,False}},
{{ϕ,θ,"Unfold projection"},θ,0.001}
]
]
]
]