Function Repository Resource:

GeoElevationRegion

Source Notebook

Generate a 3D mesh region for geographic locations with accurate elevation data

Contributed by: Greg Hurst and Jeff Bryant

ResourceFunction["GeoElevationRegion"][loc]

returns a 3D mesh region representing loc with accurate elevation data.

Details and Options

If the location is an entity with a polygon property, then data will be clipped at the polygon edge
ResourceFunction["GeoElevationRegion"] accepts the following options:
"BaseElevation"Automaticbase elevation
GeoModelAutomaticmodel of the Earth (or other body) to use
GeoZoomLevelAutomaticlevel of resolution of the elevation array
"ProjectedRegion"Trueprojected region
"RegionType"Automaticregion type
"ScaleFactor"Automaticscale factor to use for vertical exaggeration

"RegionType" can take any of the following values:

Automaticautomatically determine the region type
"BoundaryMeshRegion"create a boundary mesh region
"FullBoundaryMeshRegion"create a full boundary mesh region
"FullMeshRegion"create a full mesh region
"MeshRegion"create a mesh region
The spatial resolution of the requested region can be selected with GeoZoomLevelzoom, where zoom is a positive integer. These are the maximum zoom levels available for each celestial body and their corresponding resolutions at the equator:
"Earth"max zoom 12
"Mars"max zoom 7
"Mercury"max zoom 6
"Moon"max zoom 8
"Pluto"max zoom 5

Examples

Basic Examples (4) 

Create a mesh region for Mount Everest:

In[1]:=
ResourceFunction["GeoElevationRegion"][
 Entity["Mountain", "MountEverest"]]
Out[1]=

Create a mesh region for a set of disks around a set of positions:

In[2]:=
ResourceFunction["GeoElevationRegion"][
 GeoPosition[
  Join @@ Table[{28 + 0.27 i, 87 + 0.27 j}, {i, -1, 1}, {j, -1, 1}]]]
Out[2]=

Create a mesh region for Hawaii:

In[3]:=
ResourceFunction["GeoElevationRegion"][
 Entity["AdministrativeDivision", {"Hawaii", "UnitedStates"}]]
Out[3]=

Create a mesh region for the United States:

In[4]:=
ResourceFunction["GeoElevationRegion"][
 Entity["Country", "UnitedStates"]]
Out[4]=

Scope (3) 

Create a mesh for Hawaii,clipped at the polygon edge:

In[5]:=
location = Entity["AdministrativeDivision", {"Hawaii", "UnitedStates"}];
In[6]:=
ResourceFunction["GeoElevationRegion"][location]
Out[6]=

Create a mesh for Hawaii, but extend the data out to 200 miles, including bathymetry data:

In[7]:=
mesh = ResourceFunction["GeoElevationRegion"][
  GeoDisk[location["Position"], Quantity[200, "Miles"]]]
Out[7]=

Elevations below sea level can be removed using ProjectedRegion and BaseElevation:

In[8]:=
ResourceFunction["GeoElevationRegion"][
 GeoDisk[location["Position"], Quantity[200, "Miles"]], "ProjectedRegion" -> False, "BaseElevation" -> Quantity[0, "Meters"],
  GeoZoomLevel -> 8]
Out[8]=

Options (7) 

BaseElevation (1) 

"BaseElevation" can be used together with "ProjectedRegion"False to ignore elevations below a specified threshold:

In[9]:=
Show[ResourceFunction["GeoElevationRegion"][
  Entity["Mountain", "MountSaintHelens"], "ProjectedRegion" -> False, "BaseElevation" -> Quantity[0, "Feet"]], ViewPoint -> {2.16, 3.4, -0.11}, ViewVertical -> {0.1, 0.14, 1}]
Out[9]=
In[10]:=
Show[ResourceFunction["GeoElevationRegion"][
  Entity["Mountain", "MountSaintHelens"], "ProjectedRegion" -> False, "BaseElevation" -> Quantity[4000, "Feet"]], ViewPoint -> {2.16, 3.4, -0.11}, ViewVertical -> {0.1, 0.14, 1}]
Out[10]=

GeoModel (1) 

Specify regions for other geomodels:

In[11]:=
ResourceFunction["GeoElevationRegion"][{{-20, -30}, {20, 30}}, GeoModel -> "Moon", "ScaleFactor" -> 5]
Out[11]=

GeoZoomLevel (1) 

Generate meshes with different resolutions:

In[12]:=
ResourceFunction["GeoElevationRegion"][
 Entity["Mountain", "MountEverest"], GeoZoomLevel -> 8]
Out[12]=
In[13]:=
ResourceFunction["GeoElevationRegion"][
 Entity["Mountain", "MountEverest"], GeoZoomLevel -> 11]
Out[13]=
In[14]:=
Table[ResourceFunction["GeoElevationRegion"][
  Entity["AdministrativeDivision", {"Illinois", "UnitedStates"}], GeoZoomLevel -> i], {i, 1, 6}]
Out[14]=

ProjectedRegion (2) 

By default, regions are projected onto a flat surface:

In[15]:=
Show[ResourceFunction["GeoElevationRegion"][
  Entity["Country", "UnitedStates"]], ViewPoint -> {-0.13, -2.82, 1.86}, ViewVertical -> {0, -0.03, 1}]
Out[15]=

To maintain a spherical surface, "ProjectedRegion" can be set to False:

In[16]:=
Show[ResourceFunction["GeoElevationRegion"][
  Entity["Country", "UnitedStates"], "ProjectedRegion" -> False], ViewPoint -> {0.02, 3.0, -1.47}, ViewVertical -> {0.02, 0.87, 0.49}]
Out[16]=

RegionType (1) 

Different types of regions can be constructed:

In[17]:=
mr = ResourceFunction["GeoElevationRegion"][
  Entity["Mountain", "HalfDome"], "RegionType" -> "MeshRegion"]
Out[17]=
In[18]:=
MeshRegionQ[mr]
Out[18]=
In[19]:=
bmr = ResourceFunction["GeoElevationRegion"][
  GeoDisk[Entity["SolarSystemFeature", "OlympusMonsMars"], Quantity[400, "Miles"]], "ScaleFactor" -> 5]
Out[19]=
In[20]:=
BoundaryMeshRegionQ[bmr]
Out[20]=

ScaleFactor (1) 

Specify vertical exaggeration:

In[21]:=
ResourceFunction["GeoElevationRegion"][
 Entity["City", {"Denver", "Colorado", "UnitedStates"}], "ScaleFactor" -> 10]
Out[21]=
In[22]:=
ResourceFunction["GeoElevationRegion"][{{0, -20}, {50, 70}}, "ScaleFactor" -> 10]
Out[22]=
In[23]:=
ResourceFunction["GeoElevationRegion"][
 GeoPolygon[{GeoPosition[{10, -50.6}], GeoPosition[{70, 0.2}], GeoPosition[{20, 30}], GeoPosition[{-30, 0}]}], "ScaleFactor" -> 10]
Out[23]=
In[24]:=
ResourceFunction["GeoElevationRegion"][
 GeoVariant[Entity["Country", "UnitedStates"], "SimplifiedArea"], "ScaleFactor" -> 10]
Out[24]=

Properties and Relations

GeoElevationRegion is similar to GeoElevationGraphics3D, but there are differences.

In[25]:=
mesh = ResourceFunction["GeoElevationRegion"][
  Entity["Country", "UnitedStates"], "ProjectedRegion" -> False]
Out[25]=
In[26]:=
graphics = ResourceFunction["GeoElevationGraphics3D"][
  Entity["Country", "UnitedStates"]]
Out[26]=
In[27]:=
mesh // Head
Out[27]=
In[28]:=
graphics // Head
Out[28]=

In addition, GeoElevationGraphics3D always generates elevations from a flat surface, but GeoElevationRegion allows the data to be with respect to a spherical Earth

Possible Issues (1) 

The number of polygons for the entire world is large for the smallest GeoZoomLevel:

In[29]:=
AbsoluteTiming[
 MeshCellCount[
  ResourceFunction["GeoElevationRegion"][
   GeoBoundsRegion[{{-90, 90}, {-180, 180}}], GeoZoomLevel -> 1]]]
Out[29]=

Neat Examples

In[30]:=
solfatara = GeoPosition[Entity["Volcano", "Solfatara::w5swn"]];
In[31]:=
reorient = {-1, -1, 1};
In[32]:=
Show[ResourceFunction["GeoElevationRegion"][
  Entity["AdministrativeDivision", {"Campania", "Italy"}], "ProjectedRegion" -> False, "BaseElevation" -> 0, "ScaleFactor" -> 1, GeoZoomLevel -> 7], ViewPoint -> reorient 2 solfatara["XYZ"]]
Out[32]=

Requirements

Wolfram Language 14.0 (January 2024) or above

Version History

  • 1.0.0 – 05 May 2025

Related Resources

License Information