Function Repository Resource:

ElevateGeoPosition

Source Notebook

Set the elevation of one or multiple geodetic positions

Contributed by: Jesse Friedman

ResourceFunction["ElevateGeoPosition"][pos,value]

return geodetic position pos with its elevation set to value.

ResourceFunction["ElevateGeoPosition"][pos,f]

apply f to each elevation value in pos.

ResourceFunction["ElevateGeoPosition"][{pos1,pos2,},]

adjust the elevation of each of the posi.

ResourceFunction["ElevateGeoPosition"][value]

represents an operator form of ResourceFunction["ElevateGeoPosition"] that can be applied to an expression.

Details and Options

pos can be a GeoPosition or GeoGridPosition object, or an entity with an associated geographic position.
value can be a numeric object (assumed to be in meters) or a Quantity expression.
With ResourceFunction["ElevateGeoPosition"][pos,f], f is applied to the elevation component of each point in pos. Any absent elevation components are taken to have a geodetic elevation of 0 meters.
ResourceFunction["ElevateGeoPosition"][entity,] is equivalent to ResourceFunction["ElevateGeoPosition"][GeoPosition@entity,].
ResourceFunction["ElevateGeoPosition"][value][pos] is equivalent to ResourceFunction["ElevateGeoPosition"][pos,value].

Examples

Basic Examples (3) 

A point 100 meters above the reference ellipsoid at the current geo location:

In[1]:=
ResourceFunction["ElevateGeoPosition"][Here, 100]
Out[1]=

Set the elevation of each member of a geo position array:

In[2]:=
ResourceFunction["ElevateGeoPosition"][RandomGeoPosition[10], 30]
Out[2]=
In[3]:=
%["Elevation"]
Out[3]=

Get a GeoPosition representing the summit of Olympus Mons:

In[4]:=
ResourceFunction["ElevateGeoPosition"][
 Entity["SolarSystemFeature", "OlympusMonsMars"], Entity["SolarSystemFeature", "OlympusMonsMars"]["Elevation"]]
Out[4]=

Scope (4) 

GeoPosition objects of arbitrary dimensions are supported:

In[5]:=
{
 ResourceFunction["ElevateGeoPosition"][RandomGeoPosition[{2, 2}], 100],
 ResourceFunction["ElevateGeoPosition"][RandomGeoPosition[{2, 2, 2}], 100],
 ResourceFunction["ElevateGeoPosition"][
  RandomGeoPosition[{2, 2, 2, 2}], 100]
 }
Out[5]=
In[6]:=
{#["Depth"], #["Elevation"]} & /@ % // Grid
Out[6]=

GeoGridPosition objects are supported:

In[7]:=
ResourceFunction["ElevateGeoPosition"][
 GeoGridPosition[{-0.26284, 0.67385, 20}, "Bonne"], 300]
Out[7]=

Add 100km to the current elevations of each of the GPS satellites by supplying a transformation function:

In[8]:=
gpsPositions = EntityValue[EntityClass["Satellite", "GPS"], "Position"];
ListPlot[{
  #["Elevation"] & /@ gpsPositions,
  #["Elevation"] & /@ ResourceFunction["ElevateGeoPosition"][
    gpsPositions, # + Quantity[100, "Kilometers"] &]
  }]
Out[9]=

An operator form of ElevateGeoPosition is available:

In[10]:=
ResourceFunction["ElevateGeoPosition"][40] /@ GeoEntities[Entity["Country", "Iceland"], "City"][[;; 3]]
Out[10]=

Possible Issues (2) 

GeoPositionXYZ and GeoPositionENU objects are not supported, as they do not directly encode geodetic elevation:

In[11]:=
xyz = GeoPositionXYZ[{148217.79, -4.88253*^6, 4.0877119*^6}];
enu = GeoPositionENU[{2344, 138231, 0}, GeoPosition[{45, 0}]];
ResourceFunction["ElevateGeoPosition"][{xyz, enu}, 40] // Column
Out[12]=

These positions can be used by converting them to GeoPosition objects before applying ElevateGeoPosition, and back to their original coordinate systems after:

In[13]:=
GeoPositionXYZ[
 ResourceFunction["ElevateGeoPosition"][GeoPosition@xyz, 40]]
Out[13]=
In[14]:=
GeoPositionENU[
 ResourceFunction["ElevateGeoPosition"][GeoPosition@enu, 40], enu["Origin"]]
Out[14]=

Publisher

Jesse Friedman

Version History

  • 1.0.0 – 22 October 2019

Related Resources

License Information