Wolfram Research

Function Repository Resource:

GeoGlobe3D

Source Notebook

Display geographical data on an interactive globe

Contributed by: Jesse Friedman

ResourceFunction["GeoGlobe3D"][primitives]

represents a three-dimensional geographical image on a globe.

Details and Options

Using ResourceFunction["GeoGlobe3D"] requires internet connectivity.
ResourceFunction["GeoGlobe3D"] returns a Graphics3D object.
ResourceFunction["GeoGlobe3D"] operates essentially by rasterizing GeoGraphics[primitives,options] and using the output as a texture to be mapped onto a sphere.
ResourceFunction["GeoGlobe3D"] uses the same primitives as GeoGraphics, with the following changes:
Point displays as a three-dimensional Point primitive
GeoMarker displays as a three-dimensional pin marker shape
ResourceFunction["GeoGlobe3D"] uses the same directives as GeoGraphics.
GeoGlobe3D has the same options as Graphics, with the following additions and changes:
"3DPrimitives" All which supported primitives to render in 3D instead of on the sphere texture
GeoCenter Automatic which position on the globe to show at the center of the final image
PerformanceGoal $PerformanceGoal aspects of performance to try to optimize
"Starfield" True whether to show a background of stars behind the globe
"SimulatedSun" False whether to use a realistic, time-accurate sun to light the globe
Some options of GeoGraphics, such as GeoProjection and GeoRange, may have no visible effect on the final image.
The option "3DPrimitives" may be set to All, None, or a list containing any of the following symbols: Point, GeoMarker.
ResourceFunction["GeoGlobe3D"][] is equivalent to ResourceFunction["GeoGlobe3D"][GeoCenterHere]
With "SimulatedSun"True, the date supplied to the first DayHemisphere, NightHemisphere, or DayNightTerminator primitive in primitives is used to calculate the position of the simulated sun. If no such primitive exists, Now is used.
With "SimulatedSun"datespec where datespec is a DateObject, datespec is used to calculate the position of the simulated sun.
ResourceFunction["GeoGlobe3D"][GeoGraphics[primitives,options]] is equivalent to ResourceFunction["GeoGlobe3D"][primitives,options].

Examples

Basic Examples

Show a globe centered on your current location:

In[1]:=
ResourceFunction["GeoGlobe3D"][]
Out[1]=

Show a globe with a GeoMarker indicating Iceland:

In[2]:=
ResourceFunction["GeoGlobe3D"][
 GeoMarker[Entity["Country", "Iceland"]], GeoCenter -> Here]
Out[2]=

Display a globe showing the illumination of Earth by the Sun right now:

In[3]:=
ResourceFunction["GeoGlobe3D"][{
  Blue, DayNightTerminator[],
  Red, GeoPath["ArcticCircle"], GeoPath["AntarcticCircle"]
  }, GeoCenter -> Here, "SimulatedSun" -> True]
Out[3]=

Show a globe using satellite imagery:

In[4]:=
ResourceFunction["GeoGlobe3D"][GeoBackground -> "Satellite"]
Out[4]=

Display the planet Mars:

In[5]:=
ResourceFunction["GeoGlobe3D"][
 GeoMarker[Entity["SolarSystemFeature", "OlympusMonsMars"]],
 GeoModel -> Entity["Planet", "Mars"],
 GeoCenter -> Entity["SolarSystemFeature", "ClaritasFossaeMars"]
 ]
Out[5]=

Scope

Show a globe using several types of primitives:

In[6]:=
ResourceFunction["GeoGlobe3D"][{
  Orange, Point[Entity[
    "City", {"London", "GreaterLondon", "UnitedKingdom"}]],
  Pink, Point[GeoPosition[{23, 44}]],
  Red, GeoPath[{Entity[
     "City", {"Tangier", "TangierTetouan", "Morocco"}], Entity["City", {"Amsterdam", "NoordHolland", "Netherlands"}]}],
  Purple, GeoDisk[Entity["City", {"Cairo", "Cairo", "Egypt"}], Quantity[500, "Kilometers"]],
  Green, Polygon@Entity["Country", "Turkey"],
  Blue, Polygon[
   GeoPosition@{Entity["City", {"Dakar", "Dakar", "Senegal"}], Entity["City", {"Khartoum", "Khartoum", "Sudan"}], Entity["City", {"Pretoria", "Gauteng", "SouthAfrica"}]}],
  GeoMarker[Entity["City", {"Longyearbyen", "Svalbard", "Svalbard"}], "Color" -> Yellow]
  }]
Out[6]=

Show a point at the capital of each country in Africa:

In[7]:=
ResourceFunction["GeoGlobe3D"][{
  Red,
  PointSize[Medium],
  Point[EntityClass["Country", "Africa"][
    EntityProperty["Country", "CapitalCity"]]]
  }, GeoCenter -> Entity["GeographicRegion", "Africa"]]
Out[7]=

Convert a GeoGraphics object to GeoGlobe3D:

In[8]:=
GeoGraphics[{Green, Polygon[Entity["Country", "UnitedStates"]]}]
Out[8]=
In[9]:=
ResourceFunction["GeoGlobe3D"][%]
Out[9]=

Show a three-dimensional relief map of Earth:

In[10]:=
ResourceFunction["GeoGlobe3D"][
 GeoBackground -> GeoStyling["ReliefMap"]]
Out[10]=

Use a custom tile server:

In[11]:=
ResourceFunction["GeoGlobe3D"][
 GeoServer -> "http://a.tile.openstreetmap.org/`1`/`2`/`3`.png"]
Out[11]=

Options

"3DPrimitives"

By default, GeoMarker and Point primitives are handled specially, rendering as three-dimensional objects instead of as part of the two-dimensional texture mapped onto the sphere:

In[12]:=
ResourceFunction["GeoGlobe3D"][{
  GeoMarker[Entity["Country", "Panama"], "Color" -> Blue],
  Red, Point[Entity["City", {"Nome", "Alaska", "UnitedStates"}]],
  Green, Point[GeoPosition[{63, 100}]]
  },
 GeoCenter -> Entity["City", {"SanFrancisco", "California", "UnitedStates"}]]
Out[12]=

Force all primitives to render as part of the texture:

In[13]:=
ResourceFunction["GeoGlobe3D"][{
  GeoMarker[Entity["Country", "Panama"], "Color" -> Blue],
  Red, Point[Entity["City", {"Nome", "Alaska", "UnitedStates"}]],
  Green, Point[GeoPosition[{63, 100}]]
  },
 GeoCenter -> Entity["City", {"SanFrancisco", "California", "UnitedStates"}],
 "3DPrimitives" -> None]
Out[13]=

Force only some primitives to render as part of the texture:

In[14]:=
ResourceFunction["GeoGlobe3D"][{
  GeoMarker[Entity["Country", "Panama"], "Color" -> Blue],
  Red, Point[Entity["City", {"Nome", "Alaska", "UnitedStates"}]],
  Green, Point[GeoPosition[{63, 100}]]
  },
 GeoCenter -> Entity["City", {"SanFrancisco", "California", "UnitedStates"}],
 "3DPrimitives" -> {Point}]
Out[14]=

GeoCenter

Center the globe on the Royal Observatory in England:

In[15]:=
ResourceFunction["GeoGlobe3D"][
 GeoCenter -> Entity["AstronomicalObservatory", "Greenwich"]]
Out[15]=

"Starfield"

By default, a starfield is rendered behind the globe:

In[16]:=
ResourceFunction["GeoGlobe3D"][]
Out[16]=

Disable the starfield:

In[17]:=
ResourceFunction["GeoGlobe3D"]["Starfield" -> False]
Out[17]=

“SimulatedSun”

Show the illumination of Earth by the Sun right now:

In[18]:=
ResourceFunction["GeoGlobe3D"][GeoCenter -> Here, "SimulatedSun" -> True]
Out[18]=

Show the illumination of Earth by the Sun at a certain point in time:

In[19]:=
ResourceFunction["GeoGlobe3D"][GeoCenter -> Here, "SimulatedSun" -> DateObject[{1969, 7, 21, 22, 56}, "Minute", "Gregorian", -4.`]]
Out[19]=

With "SimulatedSun"Automatic, the date of the first DayHemisphere, NightHemisphere, or DayNightTerminator primitive in the graphic is used, if one is present:

In[20]:=
ResourceFunction[
 "GeoGlobe3D"][{Red, DayNightTerminator[
   DateObject[{1988, 6, 23, 12, 0, 0}, "Instant", "Gregorian", -4.`]]}, GeoCenter -> Entity["City", {"SantaClara", "California", "UnitedStates"}], "SimulatedSun" -> Automatic]
Out[20]=

Properties and Relations

ResourceFunction["GeoGraphics3D"] provides similar functionality to GeoGlobe3D:

In[21]:=
Grid[{{Labeled[
    ResourceFunction["GeoGlobe3D"][
     GeoCenter -> GeoPosition[{45, 135}]], "GeoGlobe3D"], Labeled[ResourceFunction[
ResourceObject[
Association[
       "Name" -> "GeoGraphics3D", "ShortName" -> "GeoGraphics3D", "UUID" -> "5bf07d2b-a25d-4148-954f-5100e217b29d", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "A 3D rotatable sphere version of \
GeoGraphics", "RepositoryLocation" -> URL[
         "https://www.wolframcloud.com/objects/resourcesystem/api/1.\
0"], "SymbolName" -> "FunctionRepository`$\
7d325a9320784d858bb94f3aa51f0827`GeoGraphics3D", "FunctionLocation" -> CloudObject[
         "https://www.wolframcloud.com/obj/f149d1d5-5cb7-4764-9581-\
ad138b43bef9"]], {ResourceSystemBase -> Automatic}]][{}, SphericalRegion -> True], "GeoGraphics3D"]}}]
Out[21]=

Geographic positions with nonzero elevation are displayed in the appropriate position relative to Earth’s surface:

In[22]:=
ResourceFunction[
 "GeoGlobe3D"][{Red, Point[Table[
    GeoPosition[{lat, 90, Quantity[lat*5, "Miles"]}], {lat, -90, 90, 10}]]}, GeoCenter -> GeoPosition[{0, 0}]]
Out[22]=

In two-dimensional map projections, Tissot's indicatricies vary in area, shape, or both:

In[23]:=
indicatrixMap = GeoGraphics[{
    Orange,
    GeoStyling[Opacity[1]],
    Table[
     GeoDisk[GeoPosition@{lat, lon}, Quantity[350, "Miles"]], {lat, -90, 90, 30}, {lon, -180, 179, 30}]
    }, GeoCenter -> Here];
GraphicsRow[
 Show[indicatrixMap, GeoProjection -> #] & /@ {"Mercator", "Mollweide", "WinkelTripel"}, ImageSize -> Full]
Out[24]=

On a sphere, all of the indicatrices are identical:

In[25]:=
ResourceFunction["GeoGlobe3D"][indicatrixMap, GeoCenter -> Here]
Out[25]=

Possible Issues

Labels that are part of the map style may become unreadable near the poles, as they are distorted when the texture is mapped onto the sphere:

In[26]:=
ResourceFunction["GeoGlobe3D"][GeoCenter -> GeoPosition["SouthPole"], ImageSize -> Medium]
Out[26]=

Use GeoBackgroundGeoStyling["StreetMapNoLabels"] to disable the labels on the default map style:

In[27]:=
ResourceFunction["GeoGlobe3D"][GeoCenter -> GeoPosition["SouthPole"], GeoBackground -> GeoStyling["StreetMapNoLabels"], ImageSize -> Medium]
Out[27]=

Some geographical primitives vary in thickness with latitude, as they are distorted when the texture is mapped onto the sphere:

In[28]:=
ResourceFunction[
 "GeoGlobe3D"][{Red, Thick, Line[{GeoPosition["NorthPole"], GeoPosition["SouthPole"]}]}, GeoCenter -> GeoPosition[{45, 0}]]
Out[28]=

As most primitives are rendered to an image which is mapped onto the globe, certain interactive functionality will not work:

In[29]:=
ResourceFunction[
 "GeoGlobe3D"][{Green, Tooltip[Polygon[Entity["Country", "UnitedStates"]], "This tooltip doesn't work"]}]
Out[29]=

The "SimulatedSun" option does not support astronomical bodies other than Earth:

In[30]:=
ResourceFunction["GeoGlobe3D"][GeoModel -> Entity["Planet", "Mars"], "SimulatedSun" -> Now]
Out[30]=

GeoGlobe3D produces a sphere, which does not reflect the eccentricity of the Earth ellipsoid:

In[31]:=
ResourceFunction["GeoGlobe3D"][GeoCenter -> GeoPosition[{0, 0}]]
Out[31]=

This eccentricity is essentially invisible at planet-scale:

In[32]:=
Graphics3D[
 Ellipsoid[{0, 0, 0}, QuantityMagnitude[
    GeodesyData["ITRF00", #] & /@ {"SemimajorAxis", "SemiminorAxis"}][[{1, 1, 2}]]], ViewPoint -> Front]
Out[32]=

The "SimulatedSun" option does not take into account the shadow of Earth’s moon during a solar eclipse:

In[33]:=
eclipseDate = DateObject[{2017, 8, 21}];
ResourceFunction["GeoGlobe3D"][GeoCenter -> GeoPosition[{40, -88}], "SimulatedSun" -> SolarEclipse[eclipseDate]]
Out[34]=

The total and partial phases of an eclipse can be plotted directly onto the globe using the "GraphicsData" property of SolarEclipse:

In[35]:=
ResourceFunction["GeoGlobe3D"][
 SolarEclipse[eclipseDate, "GraphicsData"], GeoCenter -> GeoPosition[{40, -88}]]
Out[35]=

Interactive Examples

Make a spinning Earth animation:

In[36]:=
ResourceFunction[
ResourceObject[
Association[
   "Name" -> "SpinShow", "ShortName" -> "SpinShow", "UUID" -> "005526b5-8284-47cd-a5f7-9a6c46efd298", "ResourceType" -> "Function", "Version" -> "1.0.0", "Description" -> "Create a dynamically rotating Graphics3D \
object", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/objects/resourcesystem/api/1.0"], "SymbolName" -> "FunctionRepository`$\
3dbf5da553224198b4fd4b07fedf4809`SpinShow", "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/objects/75e6c8b7-fd00-4517-a233-\
5aab4ebeec06"]], ResourceSystemBase -> "https://www.wolframcloud.com/objects/\
resourcesystem/api/1.0"]][
 ResourceFunction["GeoGlobe3D"][GeoBackground -> "Satellite"]]
Out[36]=

Show how the Antarctic is in day-long sunlight during the summer:

In[37]:=
Manipulate[
 With[
  {date = DatePlus[DateObject[{2019}, "Hour"], {hour, "Hours"}]},
  ResourceFunction["GeoGlobe3D"][
   {White, DayNightTerminator[date]},
   GeoCenter -> GeoPosition["SouthPole"],
   GeoBackground -> "Satellite",
   "SimulatedSun" -> date
   ]
  ], {hour, 0, 24}]
Out[37]=

Neat Examples

Display the current positions of the members of the Iridium satellite constellation:

In[38]:=
ResourceFunction[
 "GeoGlobe3D"][{Red, PointSize[Medium], Point@EntityClass["Satellite", "IridiumSatellites"]}, GeoBackground -> "Satellite"]
Out[38]=

Show where sunrise is happening right now:

In[39]:=
ResourceFunction["GeoGlobe3D"][
 GeoCenter -> GeoPosition[{0, 1/Quantity[24, "Hours"] DateDifference[Now, Sunrise[GeoPosition[{0, 0}]], "Hours"]*
     Quantity[360, "AngularDegrees"]}],
 "SimulatedSun" -> Now
 ]
Out[39]=

On a two-dimensional map, a geodesic may not appear to be the shortest flight path between two locations:

In[40]:=
airports = {Entity["Airport", "KJFK"], Entity["Airport", "EGLL"]};
Labeled[GeoGraphics[{
   Red, Line[airports],
   Green, GeoPath[airports, "Geodesic"]
   }, GeoProjection -> "Equirectangular"], SwatchLegend[{Green, Red}, {"Geodesic", "Straight line (in equirectangulaar projection)"}]]
Out[41]=

Plotting the paths on a globe makes clear that the geodesic is shorter:

In[42]:=
% /. g_GeoGraphics :> ResourceFunction["GeoGlobe3D"][g]
Out[42]=

Show a rhumb line (loxodrome) spiraling towards the North Pole:

In[43]:=
ResourceFunction[
 "GeoGlobe3D"][{Red, GeoPath[{Here, Quantity[80000, "Kilometers"], 85}, "Rhumb"]}, GeoCenter -> Here]
Out[43]=

Resource History

Related Resources

License Information