---
title: "GeoPosition"
language: "en"
type: "Symbol"
summary: "GeoPosition[{lat, lon}] represents a geodetic position with latitude lat and longitude lon. GeoPosition[{lat, lon, h}] represents a geodetic position with height h relative to the reference ellipsoid. GeoPosition[{lat, lon, h}, datum] represents a geodetic position referring to the specified datum. GeoPosition[{{lat1, lon1}, {lat2, lon2}, ...}, datum] represents an array of geodetic positions. GeoPosition[entity] returns the geodetic position of the specified geographical entity."
keywords: 
- geo position
- geodetic position
- geo location
- geodetic location
- position on Earth
- latitude longitude
- lat lon
- lat long
- lat lng
- GIS
- geodesy
- mapping
- surveying
- cartography
- navigation
- positioning
- GPS
- BLH
- ITRF2000
- WGS84
- NGA
- NGS
- GEOTRANS
- geographic translator
- ecef2geodetic
- enu2geodetic
canonical_url: "https://reference.wolfram.com/language/ref/GeoPosition.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Geodesy"
    link: "https://reference.wolfram.com/language/guide/Geodesy.en.md"
  - 
    title: "Geographic Data & Entities"
    link: "https://reference.wolfram.com/language/guide/GeographicData.en.md"
  - 
    title: "Maps & Cartography"
    link: "https://reference.wolfram.com/language/guide/MapsAndCartography.en.md"
  - 
    title: "Weather Data"
    link: "https://reference.wolfram.com/language/guide/WeatherData.en.md"
  - 
    title: "Free-Form & External Input"
    link: "https://reference.wolfram.com/language/guide/FreeFormAndExternalInput.en.md"
  - 
    title: "Locations, Paths, and Routing"
    link: "https://reference.wolfram.com/language/guide/LocationsPathsAndRouting.en.md"
  - 
    title: "Scientific Data Analysis"
    link: "https://reference.wolfram.com/language/guide/ScientificDataAnalysis.en.md"
  - 
    title: "Angles and Polar Coordinates"
    link: "https://reference.wolfram.com/language/guide/AnglesAndPolarCoordinates.en.md"
  - 
    title: "Knowledge Representation & Access"
    link: "https://reference.wolfram.com/language/guide/KnowledgeRepresentationAndAccess.en.md"
  - 
    title: "Database Connectivity"
    link: "https://reference.wolfram.com/language/guide/DatabaseConnectivity.en.md"
  - 
    title: "WDF (Wolfram Data Framework)"
    link: "https://reference.wolfram.com/language/guide/WDFWolframDataFramework.en.md"
related_tutorials: 
  - 
    title: "GeoGraphics"
    link: "https://reference.wolfram.com/language/tutorial/GeoGraphics.en.md"
---
# GeoPosition

GeoPosition[{lat, lon}] represents a geodetic position with latitude lat and longitude lon.

GeoPosition[{lat, lon, h}] represents a geodetic position with height h relative to the reference ellipsoid.

GeoPosition[{lat, lon, h}, datum] represents a geodetic position referring to the specified datum.

GeoPosition[{{lat1, lon1}, {lat2, lon2}, …}, datum] represents an array of geodetic positions.

GeoPosition[entity] returns the geodetic position of the specified geographical entity.

## Details

* Latitude and longitude values in ``GeoPosition[{lat, lon}]`` can be given as decimal degrees, DMS strings, or ``Quantity`` angles.

* Height ``h`` in ``GeoPosition[{lat, lon, h}]`` can be given as a numeric object in meters or as a ``Quantity`` length.

* Height ``h`` in ``GeoPosition[{lat, lon, h}]`` is geodetic height, measured with respect to the reference ellipsoid.

* ``GeoPosition[{lat, lon, h, t}]`` includes a time ``t`` that can be given as a numeric object or as a ``DateObject`` specification. A numeric ``t`` represents GMT time measured in seconds since the beginning of January 1, 1900.

* Valid latitude angles range from $-90$ to 90 degrees. Longitude angles, traditionally between $-180$ and 180 degrees, are unrestricted and interpreted modulo 360 degrees.

* A ``GeoPosition`` object with no explicit height assumes height zero with respect to the reference ellipsoid. A ``GeoPosition`` object with no explicit time assumes the current date.

* ``GeoPosition[{lat, lon}]`` assumes the default datum ``"ITRF00"``.

* Standard datums can be specified by name. Typical named datums include:

|               |                                                |
| ------------- | ---------------------------------------------- |
| "ITRF00"      | International Terrestrial Reference Frame 2000 |
| "NAD27"       | North American Datum of 1927                   |
| "NAD83CORS96" | North American Datum of 1983 (CORS96)          |

* The complete list of named datums and reference ellipsoids is given by ``GeodesyData[]``.

* ``GeoPosition[GeoPosition[{lat, lon}, datum1], datum2]`` converts between datums.

* ``GeoPosition[pos, datum]`` converts from any type of geographic position. The following coordinate types can be given: ``GeoPosition``, ``GeoPositionXYZ``, ``GeoPositionENU``, ``GeoGridPosition``.

* ``GeoPosition[pos]`` converts from any type of geographic position, keeping the same datum of ``pos``.

* ``GeoPosition`` can represent a geodetic position on a body other than Earth using ``GeoPosition[coords, body]``, where ``body`` is an ``Entity`` object of domains ``"Planet"``, ``"MinorPlanet"``, or ``"PlanetaryMoon"``.

* For an ``image`` with Exif location information, ``GeoPosition[image]`` returns that information as a ``GeoPosition`` object.

* For extended entities, ``GeoPosition[entity]`` uses when possible the position of the geographic center of the entity.

* ``GeoPosition[…][prop]`` gives the specified property of a geo position.

* Possible properties include:

|                     |                                                               |
| ------------------- | ------------------------------------------------------------- |
| "AbsoluteTime"      | date as number of seconds since Jan 1, 1900, 00:00 GMT        |
| "Count"             | number of positions in the GeoPosition object                 |
| "Data"              | first argument of the GeoPosition object                      |
| "DateList"          | date list {y, m, d, h, m, s} in GMT time                      |
| "DateObject"        | full date object                                              |
| "Datum"             | datum of the GeoPosition object                               |
| "Depth"             | point depth: 0 for a single position, 1 for a list of them, … |
| "Dimension"         | number of coordinates for each position                       |
| "Elevation"         | numeric elevation in meters, with respect to the ellipsoid    |
| "Latitude"          | numeric latitude in degrees                                   |
| "LatitudeLongitude" | numeric {lat, lon} pair in degrees                            |
| "Longitude"         | numeric longitude in degrees                                  |
| "LongitudeLatitude" | numeric {lon, lat} pair in degrees                            |
| "PackingType"       | Integer or Real if data is packed; None otherwise             |

## Examples (39)

### Basic Examples (4)

A geodetic position in the default reference frame:

```wl
In[1]:= GeoPosition[{37, -109}]

Out[1]= GeoPosition[{37, -109}]
```

---

The geo location of a city:

```wl
In[1]:= GeoPosition[Entity["City", {"NewYork", "NewYork", "UnitedStates"}]]

Out[1]= GeoPosition[{40.6643, -73.9385}]
```

---

The current position of the International Space Station, including height and time information:

```wl
In[1]:= SatelliteData[Entity["Satellite", "25544"], "Position"]

Out[1]= GeoPosition[{-47.9611, -124.661, 426753., 3.814198461806996`16.33397827010365*^9}]
```

---

A position that explicitly refers to the ITRF00 reference frame:

```wl
In[1]:= GeoPosition[{40.112981, -88.261227, 192.868}, "ITRF00"]

Out[1]= GeoPosition[{40.113, -88.2612, 192.868}, "ITRF00"]
```

Convert this position to NAD 83 (CORS96) coordinates:

```wl
In[2]:= GeoPosition[ %, "NAD83CORS96"]

Out[2]= GeoPosition[{40.113, -88.2612, 194.009}, "NAD83CORS96"]
```

Convert to Cartesian geocentric coordinates:

```wl
In[3]:= GeoPositionXYZ[%]

Out[3]= GeoPositionXYZ[{148218., -4.882534099628989*^6, 4.087711971432877*^6}, "NAD83CORS96"]
```

Convert back to geodetic coordinates:

```wl
In[4]:= GeoPosition[%]

Out[4]= GeoPosition[{40.113, -88.2612, 194.009}, "NAD83CORS96"]
```

Convert back to ITRF00:

```wl
In[5]:= GeoPosition[%, "ITRF00"]

Out[5]= GeoPosition[{40.113, -88.2612, 192.868}, "ITRF00"]
```

### Scope (19)

#### Position Specification (9)

A geo position identified by values of latitude and longitude, respectively, both in degrees:

```wl
In[1]:= GeoPosition[{40.11, -88.24}]

Out[1]= GeoPosition[{40.11, -88.24}]
```

Specify height, in meters:

```wl
In[2]:= GeoPosition[{40.11, -88.24, 244.32}]

Out[2]= GeoPosition[{40.11, -88.24, 244.32}]
```

Specify time as well, in seconds since 1900:

```wl
In[3]:= GeoPosition[{40.11, -88.24, 244.32, 3.6*^9}]

Out[3]= GeoPosition[{40.11, -88.24, 244.32, 3.6*^9}]
```

---

Give an average location for a geographical entity:

```wl
In[1]:= city = Entity["City", {"London", "GreaterLondon", "UnitedKingdom"}]

Out[1]= Entity["City", {"London", "GreaterLondon", "UnitedKingdom"}]

In[2]:= GeoPosition[city]

Out[2]= GeoPosition[{51.5, -0.116667}]
```

---

Angles given as ``Quantity`` objects are converted into numeric angles, in degrees:

```wl
In[1]:= GeoPosition[{Quantity[40.11, "AngularDegrees"], Quantity[-2., "Radians"]}]

Out[1]= GeoPosition[{40.11, -114.592}]
```

Heights and dates are also canonicalized to meters and seconds, respectively:

```wl
In[2]:= GeoPosition[{Quantity[20, "AngularDegrees"], Quantity[-10, "AngularDegrees"], Quantity[1, "Kilometers"], DateObject[]}]

Out[2]= GeoPosition[{20, -10, 1000, 3.814198481337339*^9}]
```

---

Input angles as DMS strings:

```wl
In[1]:= GeoPosition[{"40°6'36.''", "28°14'24.''W"}]

Out[1]= GeoPosition[{40.11, -28.24}]
```

---

Write ``GeoPosition`` objects in DMS string form:

```wl
In[1]:= DMSString[GeoPosition[{40.11, -28.24}]]

Out[1]= "40°6'36.000\"N 28°14'24.000\"W"
```

---

A ``GeoPosition`` object with no height information is assumed to have zero geodetic height:

```wl
In[1]:= GeoPositionXYZ[GeoPosition[{40, 30}]] === GeoPositionXYZ[GeoPosition[{40, 30, 0}]]

Out[1]= True
```

A ``GeoPosition`` object with no time information is assumed to have the current date:

```wl
In[2]:= {DateValue[GeoPosition[{40, 30}]], DateObject[]}

Out[2]= {DateObject[{2020, 11, 12, 13, 34, 51.074481}, "Instant", "Gregorian", -6.], DateObject[{2020, 11, 12, 13, 34, 51.074496}, "Instant", "Gregorian", -6.]}
```

---

Extract Exif location information from an image:

```wl
In[1]:= GeoPosition[[image]]

Out[1]= GeoPosition[{40.1259, -88.21, 225.}]
```

---

A geo position that specifies its datum:

```wl
In[1]:= GeoPosition[{40.11, -88.24}, "WGS72"]

Out[1]= GeoPosition[{40.11, -88.24}, "WGS72"]
```

Transform to a different datum:

```wl
In[2]:= GeoPosition[%, "ITRF90"]

Out[2]= GeoPosition[{40.11, -88.2398}, "ITRF90"]
```

Transform to the original datum:

```wl
In[3]:= GeoPosition[%, "WGS72"]

Out[3]= GeoPosition[{40.11, -88.24}, "WGS72"]
```

Height is modified in a change of datum, but not time:

```wl
In[4]:= GeoPosition[{40.11, -88.24, 244.32, 3.6*^9}, "WGS72"]

Out[4]= GeoPosition[{40.11, -88.24, 244.32, 3.6*^9}, "WGS72"]

In[5]:= GeoPosition[%, "ITRF90"]

Out[5]= GeoPosition[{40.11, -88.2398, 246.525, 3.6*^9}, "ITRF90"]
```

---

Named locations:

```wl
In[1]:= GeoPosition["NorthPole"]

Out[1]= GeoPosition[{90, 0}]

In[2]:= GeoPosition["NullIsland"]

Out[2]= GeoPosition[{0, 0}]
```

These are the current locations of the magnetic poles, as determined by ``GeomagneticModelData`` :

```wl
In[3]:= GeoPosition["NorthGeomagneticPole"]

Out[3]= GeoPosition[{80.63, -72.6821}]

In[4]:= GeoPosition["NorthModelDipPole"]

Out[4]= GeoPosition[{86.4187, 158.312}]
```

#### Geo Position Arrays (4)

To speed up computations, use an array of points as the first argument:

```wl
In[1]:= pairs = RandomReal[{-90, 90}, {10000, 2}];
```

All points are transformed at once:

```wl
In[2]:= AbsoluteTiming[r1 = GeoGridPosition[GeoPosition[pairs], "Albers"];]

Out[2]= {0.00622, Null}
```

Here each point is transformed individually:

```wl
In[3]:= AbsoluteTiming[r2 = GeoGridPosition[GeoPosition[#], "Albers"]& /@ pairs;]

Out[3]= {2.18029, Null}
```

Results coincide up to numerical error:

```wl
In[4]:= First[r1] - (First /@ r2)//Abs//Max

Out[4]= 8.881784197001252`*^-16
```

---

Changes of datum are also faster using an array of points as the first argument:

```wl
In[1]:= pairs = RandomReal[{-90, 90}, {10000, 2}];

In[2]:= AbsoluteTiming[r1 = GeoPosition[GeoPosition[pairs, "WGS72"], "ITRF90"];]

Out[2]= {0.022857, Null}

In[3]:= AbsoluteTiming[r2 = GeoPosition[GeoPosition[#, "WGS72"], "ITRF90"]& /@ pairs;]

Out[3]= {15.7248, Null}

In[4]:= First[r1] - (First /@ r2)//Abs//Max

Out[4]= 2.842170943040401`*^-14
```

---

``GeoPosition`` can contain nested lists of points, as long as all points have the same length and depth:

```wl
In[1]:= GeoPosition[{{{1., 2., 3.}, {4., 5., 6.}}, {{7., 8., 9.}}}]

Out[1]= GeoPosition[{{{1., 2., 3.}, {4., 5., 6.}}, {{7., 8., 9.}}}]
```

Manipulations will preserve the nesting structure:

```wl
In[2]:= GeoGridPosition[%, "Mercator"]

Out[2]=
GeoGridPosition[{{{2., 1.0000507734366284, 3.}, {5., 4.0032532172070825, 6.}}, 
  {{8., 7.017479226876329, 9.}}}, "Mercator"]

In[3]:= GeoPosition[%]

Out[3]=
GeoPosition[{{{1.0000000000000013, 2., 3.}, {4.000000000000005, 5., 6.}}, 
  {{6.999999999999997, 8., 9.}}}]
```

However, this is not allowed, because the first point has a height specification, but not the second:

```wl
In[4]:= GeoPosition[{{1, 2, 3}, {4, 5}}]
```

GeoPosition::gdim: Geo location GeoPosition[{{1,2,3},{4,5}}] contains coordinate lists of different dimensions.

```wl
Out[4]= GeoPosition[{{1, 2, 3}, {4, 5}}]
```

This is not allowed because the second point is deeper than the first:

```wl
In[5]:= GeoPosition[{{1, 2}, {{3, 4}}}]
```

GeoPosition::gdepth: Geo location GeoPosition[{{1,2},{{3,4}}}] contains coordinate lists of different array depths.

```wl
Out[5]= GeoPosition[{{1, 2}, {{3, 4}}}]
```

---

Convert a list of geo positions into a single geo position array:

```wl
In[1]:= {GeoPosition[{0, 0}], GeoPosition[{40.3, -20.}], GeoPosition[{90, 90}]}

Out[1]= {GeoPosition[{0, 0}], GeoPosition[{40.3, -20.}], GeoPosition[{90, 90}]}

In[2]:= GeoPosition[%]

Out[2]= GeoPosition[{{0, 0}, {40.3, -20.}, {90, 90}}]
```

Convert back to a list of geo positions:

```wl
In[3]:= Thread[%]

Out[3]= {GeoPosition[{0, 0}], GeoPosition[{40.3, -20.}], GeoPosition[{90, 90}]}
```

#### Coordinate Extraction (4)

Extract date information using ``DateValue`` :

```wl
In[1]:= DateString[]

Out[1]= "Thu 12 Nov 2020 13:37:02"

In[2]:= p = GeoPosition[{-40.3, 178.1, 0., %}]

Out[2]= GeoPosition[{-40.3, 178.1, 0., 3.814198622*^9}]

In[3]:= DateValue[p]

Out[3]= DateObject[{2020, 11, 12, 19, 37, 2.}, "Instant", "Gregorian", 0.]
```

Numeric time in ``GeoPosition`` is interpreted as GMT time. Convert to local time:

```wl
In[4]:= TimeZoneConvert[%, $TimeZone]

Out[4]= DateObject[{2020, 11, 12, 13, 37, 2.}, "Instant", "Gregorian", -6.]
```

Extract the year as an integer number:

```wl
In[5]:= DateValue[p, "Year", Integer]

Out[5]= 2020
```

---

Extract the coordinates from a ``GeoPosition`` object:

```wl
In[1]:= p = GeoPosition[{40.21, -85.53, 125.2}]

Out[1]= GeoPosition[{40.21, -85.53, 125.2}]

In[2]:= First[p]

Out[2]= {40.21, -85.53, 125.2}
```

Extract latitude, longitude or both, as ``Quantity`` angles:

```wl
In[3]:= Latitude[p]

Out[3]= Quantity[40.21, "AngularDegrees"]

In[4]:= Longitude[p]

Out[4]= Quantity[-85.53, "AngularDegrees"]

In[5]:= LatitudeLongitude[p]

Out[5]= {Quantity[40.21, "AngularDegrees"], Quantity[-85.53, "AngularDegrees"]}
```

---

Use properties to extract information from a ``GeoPosition`` object:

```wl
In[1]:= p = Here

Out[1]= GeoPosition[{40.11, -88.24}]

In[2]:= p["Properties"]

Out[2]= {"AbsoluteTime", "Count", "Data", "DateList", "DateObject", "Datum", "Depth", "Dimension", "Elevation", "Latitude", "LatitudeLongitude", "Longitude", "LongitudeLatitude", "PackingType"}

In[3]:= AssociationMap[p, %]//Normal//Column

Out[3]=
"AbsoluteTime" -> 3.814198653609565`16.3339782976706*^9
"Count" -> 1
"Data" -> {40.11, -88.24}
"DateList" -> {2020, 11, 12, 19, 37, 33.609676}
"DateObject" -> DateObject[{2020, 11, 12, 19, 37, 33.609746}, "Instant", "Gregorian", 0.]
"Datum" -> "ITRF00"
"Depth" -> 0
"Dimension" -> 2
"Elevation" -> 0
"Latitude" -> 40.11
"LatitudeLongitude" -> {40.11, -88.24}
"Longitude" -> -88.24
"LongitudeLatitude" -> {-88.24, 40.11}
"PackingType" -> None
```

---

Use properties to extract information from a ``GeoPosition`` array:

```wl
In[1]:= p = RandomGeoPosition["World", {10, 20}]

Out[1]= GeoPosition[CompressedData["«4389»"]]
```

There are 200 points:

```wl
In[2]:= p["Count"]

Out[2]= 200
```

It is a matrix of points, so it has point depth 2:

```wl
In[3]:= p["Depth"]

Out[3]= 2
```

Each point has dimension 2, namely latitude and longitude:

```wl
In[4]:= p["Dimension"]

Out[4]= 2
```

``RandomGeoPosition`` returns a ``GeoPosition`` object containing a packed array with type ``Real`` :

```wl
In[5]:= p["PackingType"]

Out[5]= Real
```

Any other property will return an array of values corresponding to the points of the array:

```wl
In[6]:= p["AbsoluteTime"]//Dimensions

Out[6]= {10, 20}

In[7]:= p["DateList"]//Dimensions

Out[7]= {10, 20, 6}
```

#### Datum Transformations (2)

Perform a datum transformation from the default ``"ITRF00"`` to the British datum ``"OGB7"`` of 1936:

```wl
In[1]:= p = GeoPosition[{27.7, -170.4}]

Out[1]= GeoPosition[{27.7, -170.4}]

In[2]:= q = GeoPosition[p, "OGB7"]

Out[2]= GeoPosition[{27.6933, -170.402}, "OGB7"]
```

To estimate the implied spatial change, compute geo distance ignoring the datum information:

```wl
In[3]:= GeoDistance[LatitudeLongitude[p], LatitudeLongitude[q]]

Out[3]= Quantity[0.4838893707366225, "Miles"]

In[4]:= UnitConvert[%]

Out[4]= Quantity[778.744455458759, "Meters"]
```

The change is smaller for locations in the UK:

```wl
In[5]:= p = RandomGeoPosition[Entity["Country", "UnitedKingdom"]]

Out[5]= GeoPosition[{57.9093, -4.34461}]

In[6]:= q = GeoPosition[p, "OGB7"]

Out[6]= GeoPosition[{57.9096, -4.34327}, "OGB7"]

In[7]:= GeoDistance[LatitudeLongitude[p], LatitudeLongitude[q]]

Out[7]= Quantity[283.325659643541, "Feet"]

In[8]:= UnitConvert[%]

Out[8]= Quantity[86.35766105935129, "Meters"]
```

---

Convert a geo position array of locations from the American ``"NAD27"`` datum to the European ``"EURM"`` :

```wl
In[1]:= GeoPosition[{{43.4, -104.27}, {38.51, -100.24}, {42.47, -100.9}}, "NAD27"]

Out[1]= GeoPosition[{{43.4, -104.27}, {38.51, -100.24}, {42.47, -100.9}}, "NAD27"]

In[2]:= GeoPosition[%, "EURM"]

Out[2]=
GeoPosition[{{43.4022941849546, -104.26980305962404}, {38.512319256913194, -100.23959796924173}, 
  {42.472293324798905, -100.89961552302022}}, "EURM"]
```

Extract the new coordinate values:

```wl
In[3]:= %["LatitudeLongitude"]

Out[3]= {{43.4023, -104.27}, {38.5123, -100.24}, {42.4723, -100.9}}
```

### Generalizations & Extensions (3)

Use positions on a sphere of 100 kilometers of radius:

```wl
In[1]:= GeoPosition[{32., -73.4}, Quantity[100, "Kilometers"]]

Out[1]= GeoPosition[{32., -73.4}, Quantity[100, "Kilometers"]]
```

Convert to a 3D vector:

```wl
In[2]:= GeoPositionXYZ[%]

Out[2]= GeoPositionXYZ[{24227.7, -81270.4, 52991.9}, Quantity[100, "Kilometers"]]
```

The vector components are given in meters:

```wl
In[3]:= Norm[%["XYZ"]]

Out[3]= 100000.
```

Transform back to a ``GeoPosition`` object on the sphere:

```wl
In[4]:= GeoPosition[%%]

Out[4]= GeoPosition[{32., -73.4, -1.4551915228366852`*^-11}, Quantity[100, "Kilometers"]]
```

---

Use positions on an ellipsoid of given semiaxes:

```wl
In[1]:= GeoPosition[{-29.4, 32.7}, {Quantity[1, "Kilometers"], Quantity[900, "Meters"]}]

Out[1]= GeoPosition[{-29.4, 32.7}, {Quantity[1, "Kilometers"], Quantity[900, "Meters"]}]
```

Convert to a 3D vector:

```wl
In[2]:= GeoPositionXYZ[%]

Out[2]= GeoPositionXYZ[{750.519, 481.825, -407.06}, {Quantity[1, "Kilometers"], Quantity[900, "Meters"]}]
```

Transform back to a ``GeoPosition`` object on the ellipsoid:

```wl
In[3]:= GeoPosition[%]

Out[3]= GeoPosition[{-29.4, 32.7, 0.}, {Quantity[1, "Kilometers"], Quantity[900, "Meters"]}]
```

---

A position on a geo reference model other than the Earth:

```wl
In[1]:= SolarSystemFeatureData[Entity["SolarSystemFeature", "TychoBraheMars"], "Position"]

Out[1]= GeoPosition[{-49.41, 146.12}, Entity["Planet", "Mars"]]
```

Distance from the Tycho Brahe crater to the South Pole of Mars:

```wl
In[2]:= GeoDistance[%, GeoPosition[{-90, 0}, Entity["Planet", "Mars"]]]

Out[2]= Quantity[1499.8085984389527, "Miles"]
```

Computations are performed with an ellipsoid of these semiaxis lengths:

```wl
In[3]:= PlanetData[Entity["Planet", "Mars"], {"EquatorialRadius", "PolarRadius"}]

Out[3]= {Quantity[2110.294629364511254275`4.229961983205559, "Miles"], Quantity[2097.8734192316869482224`4.5284281655255025, "Miles"]}
```

### Applications (3)

``GeoPosition`` is the main object in the Wolfram Language denoting point-like locations on the Earth:

```wl
In[1]:= p = $GeoLocation

Out[1]= GeoPosition[{40.11, -88.24}]

In[2]:= q = GeoPosition[{51.5, -0.12}]

Out[2]= GeoPosition[{51.5, -0.12}]
```

Compute distance between two points:

```wl
In[3]:= d = GeoDistance[p, q]

Out[3]= Quantity[4065.30268136569, "Miles"]
```

Compute the initial bearing of a geodesic from ``p`` to ``q`` :

```wl
In[4]:= α = GeoDirection[p, q]

Out[4]= Quantity[46.76553570829383, "AngularDegrees"]
```

Draw the geodesic between them and respective geo circles:

```wl
In[5]:= GeoGraphics[{GeoPath[{p, q}], GeoCircle[p, d / 4], GeoCircle[q, d / 4]}]

Out[5]= [image]
```

Check that the end of the geodesic starting at ``p`` is actually the point ``q`` :

```wl
In[6]:= GeoDestination[p, GeoDisplacement[{d, α}]]

Out[6]= GeoPosition[{51.5, -0.12}]
```

---

Geographical locations returned by ``EntityValue`` are given as ``GeoPosition`` objects:

```wl
In[1]:= EntityValue[Entity["Building", "TourEiffel"], "Position"]

Out[1]= GeoPosition[{48.8583, 2.29444}]
```

They can also include height and time information:

```wl
In[2]:= SatelliteData[Entity["Satellite", "25544"], "Position"]

Out[2]= GeoPosition[{-51.4707, -103.378, 426845., 3.814198690167561`16.333978299105656*^9}]
```

---

Geographical polygons have their coordinates inside a ``GeoPosition`` head:

```wl
In[1]:= polygon = EntityValue[Entity["Country", "Peru"], "Polygon"]

Out[1]= Polygon[GeoPosition[CompressedData["«28152»"]]]
```

Draw the polygon or its boundary:

```wl
In[2]:= {GeoGraphics[polygon], GeoGraphics[GeoBoundary[polygon]]}

Out[2]= {[image], [image]}
```

### Properties & Relations (7)

Convert a geodetic location to a three-dimensional Cartesian vector with respect to the reference frame of the datum, assuming geodetic height 0:

```wl
In[1]:= p = $GeoLocation

Out[1]= GeoPosition[{40.11, -88.24}]

In[2]:= GeoPositionXYZ[p]

Out[2]= GeoPositionXYZ[{150028., -4.882543214978031*^6, 4.0873344399887016*^6}]
```

Convert back to a ``GeoPosition`` specification, now with some small residual value of height:

```wl
In[3]:= GeoPosition[%]

Out[3]= GeoPosition[{40.11, -88.24, 0.}]
```

---

Convert geodetic coordinates to Cartesian coordinates for an ellipsoid of these semiaxis lengths:

```wl
In[1]:=
a = 1.;
b = 0.5;
```

Take a point ``p`` of geodetic latitude 60°, zero longitude, and geodetic height 0.15:

```wl
In[2]:= p = GeoPosition[{60., 0., 0.15}, {a, b}]

Out[2]= GeoPosition[{60., 0., 0.15}, {1., 0.5}]
```

Convert it to Cartesian coordinates:

```wl
In[3]:= pxyz = GeoPositionXYZ[p]

Out[3]= GeoPositionXYZ[{0.830929, 0., 0.457231}, {1., 0.5}]
```

Convert back to geodetic coordinates:

```wl
In[4]:= GeoPosition[pxyz]

Out[4]= GeoPosition[{60., 0., 0.15}, {1., 0.5}]
```

Take a point ``q`` of the same latitude and longitude, but zero height:

```wl
In[5]:= q = GeoPosition[{60., 0., 0.}, {a, b}]

Out[5]= GeoPosition[{60., 0., 0.}, {1., 0.5}]

In[6]:= qxyz = GeoPositionXYZ[q]

Out[6]= GeoPositionXYZ[{0.755929, 0., 0.327327}, {1., 0.5}]
```

Represent the relation between the coordinates on a vertical cut of the ellipsoid:

```wl
In[7]:=
pxz = {pxyz["X"], pxyz["Z"]}
qxz = {qxyz["X"], qxyz["Z"]}

Out[7]= {0.830929, 0.457231}

Out[7]= {0.755929, 0.327327}
```

The blue line is perpendicular to the tangent at ``q`` and forms an angle of 60° with the $x$ axis:

```wl
In[8]:= Graphics[{Circle[{0, 0}, {a, b}], PointSize[Medium], Red, Point[pxz], Line[{{0, 0}, pxz}], Blue, Point[qxz], Line[{pxz, pxz - 0.75{Cos[60Degree], Sin[60Degree]}}]}, Axes -> True]

Out[8]= [image]
```

The geodetic height of ``p`` along the geodetic vertical is the distance between ``p`` and ``q`` :

```wl
In[9]:= Norm[pxz - qxz]

Out[9]= 0.15
```

---

Project a geodetic location using various geo projections, using their default parameters:

```wl
In[1]:= p = $GeoLocation

Out[1]= GeoPosition[{40.11, -88.24}]

In[2]:= GeoGridPosition[p, "Mercator"]

Out[2]= GeoGridPosition[{-88.24, 43.8552}, "Mercator"]

In[3]:= GeoGridPosition[p, "Albers"]

Out[3]= GeoGridPosition[{-0.949732, 1.1029}, "Albers"]

In[4]:= GeoGridPosition[p, "WinkelTripel"]

Out[4]= GeoGridPosition[{-1.12062, 0.731425}, "WinkelTripel"]
```

Convert back to a ``GeoPosition`` specification:

```wl
In[5]:= GeoPosition /@ {%, %%, %%%}

Out[5]= {GeoPosition[{40.11, -88.24}], GeoPosition[{40.11, -88.24}], GeoPosition[{40.11, -88.24}]}
```

---

The antipode of a ``GeoPosition`` object is another ``GeoPosition`` object:

```wl
In[1]:= Here

Out[1]= GeoPosition[{40.11, -88.24}]

In[2]:= GeoAntipode[%]

Out[2]= GeoPosition[{-40.11, 91.76}]
```

---

``GeoPosition[{}]`` represents an empty array of geo positions:

```wl
In[1]:= GeoPosition[{}]

Out[1]= GeoPosition[{}]
```

It contains zero positions:

```wl
In[2]:= %["Count"]

Out[2]= 0
```

``GeoPosition[]`` is invalid syntax:

```wl
In[3]:= GeoPosition[]
```

GeoPosition::argt: GeoPosition called with 0 arguments; 1 or 2 arguments are expected.

```wl
Out[3]= GeoPosition[]
```

---

``GeoPosition`` inside ``Graphics`` primitives marks coordinates as being in ``{lat, lon}`` notation:

```wl
In[1]:= coords = {{0, 0}, {0, 60}, {10, 60}, {10, 0}, {0, 0}};

In[2]:= GeoGraphics[{Red, Polygon[GeoPosition[coords]], Green, Polygon[coords]}, GeoRange -> {{-10, 70}, {-10, 70}}, Frame -> True, GeoProjection -> "Equirectangular"]

Out[2]= [image]
```

---

``Graphics`` primitives containing ``GeoPosition`` coordinates are formed by straight segments in the projected map:

```wl
In[1]:= coords = {{0, 0}, {0, 60}, {10, 60}, {10, 0}, {0, 0}};

In[2]:= GeoGraphics[{Opacity[0.5], Red, Line[GeoPosition[coords]], Blue, GeoPath[coords]}, Frame -> True, GeoProjection -> "Bonne"]

Out[2]= [image]
```

### Possible Issues (2)

``Degree`` is considered as any other numeric expression:

```wl
In[1]:= GeoPosition[{30.Degree, 3.Pi}]

Out[1]= GeoPosition[{0.523599, 9.42478}]
```

Use ``Quantity`` to denote that angles are given in radians:

```wl
In[2]:= GeoPosition[{Quantity[30.Degree, "Radians"], Quantity[3.Pi, "Radians"]}]

Out[2]= GeoPosition[{30., 540.}]
```

---

From Version 10 of the Wolfram Language, numeric time is interpreted as seconds since 1900, not as years:

```wl
In[1]:= GeoPosition[{40.11, 30.23, 0., 2014.3}]
```

GeoPosition::secs: Warning: Numeric date 2014.3\` is interpreted as seconds since the beginning of 1900, not as a year specification.

```wl
Out[1]= GeoPosition[{40.11, 30.23, 0., 2014.3}]
```

### Neat Examples (1)

Take a list of images with Exif location information:

```wl
In[1]:= images = {[image], [image], [image], [image], [image], [image], [image]};
```

Extract their respective positions:

```wl
In[2]:= positions = GeoPosition /@ images;
```

Draw the points on a map, using tooltips to show the respective images:

```wl
In[3]:= GeoGraphics[{Darker[Green], GeoPath[positions], Darker[Brown], PointSize[Medium], Tooltip[Point[#1], #2]&@@@Transpose[{positions, images}]}]

Out[3]= [image]
```

## See Also

* [`GeoPositionENU`](https://reference.wolfram.com/language/ref/GeoPositionENU.en.md)
* [`GeoPositionXYZ`](https://reference.wolfram.com/language/ref/GeoPositionXYZ.en.md)
* [`GeoGridPosition`](https://reference.wolfram.com/language/ref/GeoGridPosition.en.md)
* [`GeoDistance`](https://reference.wolfram.com/language/ref/GeoDistance.en.md)
* [`GeoDestination`](https://reference.wolfram.com/language/ref/GeoDestination.en.md)
* [`Latitude`](https://reference.wolfram.com/language/ref/Latitude.en.md)
* [`Longitude`](https://reference.wolfram.com/language/ref/Longitude.en.md)
* [`GeoAntipode`](https://reference.wolfram.com/language/ref/GeoAntipode.en.md)
* [`FindGeoLocation`](https://reference.wolfram.com/language/ref/FindGeoLocation.en.md)
* [`\$GeoLocation`](https://reference.wolfram.com/language/ref/$GeoLocation.en.md)
* [`GeodesyData`](https://reference.wolfram.com/language/ref/GeodesyData.en.md)
* [`GeoVector`](https://reference.wolfram.com/language/ref/GeoVector.en.md)
* [`GeoGraphics`](https://reference.wolfram.com/language/ref/GeoGraphics.en.md)
* [`GeoPath`](https://reference.wolfram.com/language/ref/GeoPath.en.md)
* [`GeoCircle`](https://reference.wolfram.com/language/ref/GeoCircle.en.md)
* [`GeoDisk`](https://reference.wolfram.com/language/ref/GeoDisk.en.md)
* [`LocalTime`](https://reference.wolfram.com/language/ref/LocalTime.en.md)
* [`GeographicRegion`](https://reference.wolfram.com/language/ref/entity/GeographicRegion.en.md)
* [`GeoCoordinates`](https://reference.wolfram.com/language/ref/interpreter/GeoCoordinates.en.md)
* [`USGSDEM`](https://reference.wolfram.com/language/ref/format/USGSDEM.en.md)
* [`SDTSDEM`](https://reference.wolfram.com/language/ref/format/SDTSDEM.en.md)
* [`GeoTIFF`](https://reference.wolfram.com/language/ref/format/GeoTIFF.en.md)

## Tech Notes

* [GeoGraphics](https://reference.wolfram.com/language/tutorial/GeoGraphics.en.md)

## Related Guides

* [`Geodesy`](https://reference.wolfram.com/language/guide/Geodesy.en.md)
* [Geographic Data & Entities](https://reference.wolfram.com/language/guide/GeographicData.en.md)
* [Maps & Cartography](https://reference.wolfram.com/language/guide/MapsAndCartography.en.md)
* [Weather Data](https://reference.wolfram.com/language/guide/WeatherData.en.md)
* [Free-Form & External Input](https://reference.wolfram.com/language/guide/FreeFormAndExternalInput.en.md)
* [Locations, Paths, and Routing](https://reference.wolfram.com/language/guide/LocationsPathsAndRouting.en.md)
* [Scientific Data Analysis](https://reference.wolfram.com/language/guide/ScientificDataAnalysis.en.md)
* [Angles and Polar Coordinates](https://reference.wolfram.com/language/guide/AnglesAndPolarCoordinates.en.md)
* [Knowledge Representation & Access](https://reference.wolfram.com/language/guide/KnowledgeRepresentationAndAccess.en.md)
* [Database Connectivity](https://reference.wolfram.com/language/guide/DatabaseConnectivity.en.md)
* [WDF (Wolfram Data Framework)](https://reference.wolfram.com/language/guide/WDFWolframDataFramework.en.md)

## Related Links

* [An Elementary Introduction to the Wolfram Language: Geocomputation](https://www.wolfram.com/language/elementary-introduction/18-geocomputation.html)

## History

* [Introduced in 2008 (7.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn70.en.md) \| [Updated in 2014 (10.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn100.en.md) ▪ [2019 (12.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn120.en.md)