Wolfram Research

Function Repository Resource:

GeoElevationGraphics3D

Source Notebook

Visualize 3D geographics with elevation

Contributed by: Jon McLoone

ResourceFunction["GeoElevationGraphics3D"][primitives]

generates a 3D surface of GeoElevationData with GeoGraphics mapped onto the surface.

Details and Options

ResourceFunction["GeoElevationGraphics3D"] accepts most of the same options as GeoGraphics and ListPlot3D. In addition it supports the following option:
"SeaLevelStyle" None style for drawing a layer to show sea level

Examples

Basic Examples (1) 

Generate a 3D map of the region around Durham, UK:

In[1]:=
ResourceFunction["GeoElevationGraphics3D"][
 Entity["City", {"Durham", "Durham", "UnitedKingdom"}]]
Out[1]=

Scope (1) 

GeoElevationGraphics3D can accept any contents supported by GeoGraphics:

In[2]:=
ResourceFunction[
 "GeoElevationGraphics3D"][{EdgeForm[Black], Red, GeoDisk[Entity["City", {"Edinburgh", "Edinburgh", "UnitedKingdom"}],
    Quantity[500, "Meters"]]}, GeoBackground -> "VectorClassic", GeoRange -> Quantity[0.75, "Miles"]]
Out[2]=

Options (7) 

Most GeoGraphics options are supported:

In[3]:=
ResourceFunction["GeoElevationGraphics3D"][
 Entity["City", {"Durham", "Durham", "UnitedKingdom"}], GeoBackground -> "VectorClassic", GeoRange -> Quantity[0.75, "Miles"]]
Out[3]=

Most ListPlot3D options are supported:

In[4]:=
ResourceFunction["GeoElevationGraphics3D"][
 Entity["City", {"Durham", "Durham", "UnitedKingdom"}], GeoBackground -> "VectorClassic", GeoRange -> Quantity[0.75, "Miles"], MeshFunctions -> {#3 &}, Mesh -> True]
Out[4]=

All GeoBackground values are supported:

In[5]:=
ResourceFunction["GeoElevationGraphics3D"][
 Entity["City", {"Edinburgh", "Edinburgh", "UnitedKingdom"}], GeoBackground -> "Satellite", GeoServer -> "DigitalGlobe", GeoRange -> Quantity[0.25, "Miles"]]
Out[5]=

GeoElevationGraphics3D displays underwater levels by default:

In[6]:=
ResourceFunction["GeoElevationGraphics3D"][
 Entity["City", {"Honolulu", "Hawaii", "UnitedStates"}], GeoRange -> Quantity[10, "Miles"]]
Out[6]=

You can also display sea level using "SeaLevelStyle":

In[7]:=
ResourceFunction["GeoElevationGraphics3D"][
 Entity["City", {"Honolulu", "Hawaii", "UnitedStates"}], GeoRange -> Quantity[10, "Miles"], "SeaLevelStyle" -> Automatic]
Out[7]=

Display sea level using "SeaLevelStyle", which accepts any style directives:

In[8]:=
ResourceFunction["GeoElevationGraphics3D"][
 Entity["City", {"Honolulu", "Hawaii", "UnitedStates"}], GeoRange -> Quantity[10, "Miles"], "SeaLevelStyle" -> Darker@Blue]
Out[8]=

Alternatively you can use PlotRange to only display positive values:

In[9]:=
ResourceFunction["GeoElevationGraphics3D"][
 Entity["City", {"Honolulu", "Hawaii", "UnitedStates"}], GeoRange -> Quantity[10, "Miles"], PlotRange -> {0, All}, ClippingStyle -> Blue]
Out[9]=

At a large scale, some map projections produce non-rectangular regions:

In[10]:=
ResourceFunction["GeoElevationGraphics3D"][{}, GeoRange -> "World", GeoZoomLevel -> 1, GeoRange -> "World", GeoProjection -> {"Albers", "Centering" -> GeoPosition[{40, -90}], "StandardParallels" -> {30, 50}}]
Out[10]=

Using RegionFunctionAutomatic will attempt to trim the graphic to only show mapped areas:

In[11]:=
ResourceFunction["GeoElevationGraphics3D"][{}, GeoRange -> "World", GeoZoomLevel -> 1, GeoRange -> "World", GeoProjection -> {"Albers", "Centering" -> GeoPosition[{40, -90}], "StandardParallels" -> {30, 50}}, RegionFunction -> Automatic]
Out[11]=

Possible Issues (1) 

All GeoElevationGraphics3D use a planar map projection, resulting in "flat earth" graphics at a large scale:

In[12]:=
ResourceFunction["GeoElevationGraphics3D"][{}, GeoRange -> "World", GeoZoomLevel -> 1, GeoProjection -> {"LambertAzimuthal", "Centering" -> GeoPosition[{90, 0}]}, RegionFunction -> Automatic, "SeaLevelStyle" -> Automatic]
Out[12]=

Neat Examples (2) 

Drape the African nations in their national flags:

In[13]:=
flags = EntityValue[\!\(\*
NamespaceBox["LinguisticAssistant",
DynamicModuleBox[{WolframAlphaClient`Private`query$$ = "Africa", WolframAlphaClient`Private`boxes$$ = TemplateBox[{"\"Africa\"", 
RowBox[{"EntityClass", "[", 
RowBox[{"\"Country\"", ",", "\"Africa\""}], "]"}], "\"EntityClass[\\\"Country\\\", \\\"Africa\\\"]\"", "\"countries\""}, "EntityClass"], WolframAlphaClient`Private`allassumptions$$ = {{
        "type" -> "Clash", "word" -> "Africa", "template" -> "Assuming \"${word}\" is ${desc1}. Use as \
${desc2} instead", "count" -> "2", "Values" -> {{
           "name" -> "CountryClass", "desc" -> "a continent", "input" -> "*C.Africa-_*CountryClass-"}, {
           "name" -> "GivenName", "desc" -> "a given name", "input" -> "*C.Africa-_*GivenName-"}}}}, WolframAlphaClient`Private`assumptions$$ = {}, WolframAlphaClient`Private`open$$ = {1, 2}}, 
DynamicBox[ToBoxes[
AlphaIntegration`LinguisticAssistantBoxes["", 1, 
Dynamic[WolframAlphaClient`Private`query$$], 
Dynamic[WolframAlphaClient`Private`boxes$$], 
Dynamic[WolframAlphaClient`Private`allassumptions$$], 
Dynamic[WolframAlphaClient`Private`assumptions$$], 
Dynamic[WolframAlphaClient`Private`open$$]], StandardForm],
ImageSizeCache->{171., {7., 17.}},
TrackedSymbols:>{
         WolframAlphaClient`Private`query$$, WolframAlphaClient`Private`boxes$$, WolframAlphaClient`Private`allassumptions$$, WolframAlphaClient`Private`assumptions$$, WolframAlphaClient`Private`open$$}],
DynamicModuleValues:>{},
UndoTrackedVariables:>{WolframAlphaClient`Private`open$$}],
BaseStyle->{"Deploy"},
DeleteWithContents->True,
Editable->False,
SelectWithContents->True]\), {"Entity", "FlagImage"}];

Place flag images on countries:

In[14]:=
ResourceFunction[
 "GeoElevationGraphics3D"][{EdgeForm[
   Black], {GeoStyling[{"Image", #2}], Polygon[#1]} & @@@ flags}, GeoBackground -> "StreetMapNoLabels", PlotRange -> {0, All}, ClippingStyle -> Blue, BoxRatios -> {1, 1, 0.2}, Boxed -> False]
Out[14]=

Resource History

Related Resources

License Information