WOLFRAM

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 to 90 degrees. Longitude angles, traditionally between 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

open allclose all

Basic Examples  (4)Summary of the most common use cases

A geodetic position in the default reference frame:

Out[1]=1

The geo location of a city:

Out[1]=1

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

Out[1]=1

A position that explicitly refers to the ITRF00 reference frame:

Out[1]=1

Convert this position to NAD 83 (CORS96) coordinates:

Out[2]=2

Convert to Cartesian geocentric coordinates:

Out[3]=3

Convert back to geodetic coordinates:

Out[4]=4

Convert back to ITRF00:

Out[5]=5

Scope  (17)Survey of the scope of standard use cases

Position Specification  (9)

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

Out[1]=1

Specify height, in meters:

Out[2]=2

Specify time as well, in seconds since 1900:

Out[3]=3

Give an average location for a geographical entity:

Out[1]=1
Out[2]=2

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

Out[1]=1

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

Out[2]=2

Input angles as DMS strings:

Out[1]=1

Write GeoPosition objects in DMS string form:

Out[1]=1

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

Out[1]=1

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

Out[2]=2

Extract Exif location information from an image:

Out[1]=1

A geo position that specifies its datum:

Out[1]=1

Transform to a different datum:

Out[2]=2

Transform to the original datum:

Out[3]=3

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

Out[4]=4
Out[5]=5

Named locations:

Out[1]=1
Out[2]=2

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

Out[3]=3
Out[4]=4

Geo Position Arrays  (4)

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

All points are transformed at once:

Out[2]=2

Here each point is transformed individually:

Out[3]=3

Results coincide up to numerical error:

Out[4]=4

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

Out[2]=2
Out[3]=3
Out[4]=4

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

Out[1]=1

Manipulations will preserve the nesting structure:

Out[2]=2
Out[3]=3

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

Out[4]=4

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

Out[5]=5

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

Out[1]=1
Out[2]=2

Convert back to a list of geo positions:

Out[3]=3

Coordinate Extraction  (4)

Extract date information using DateValue:

Out[1]=1
Out[2]=2
Out[3]=3

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

Out[4]=4

Extract the year as an integer number:

Out[5]=5

Extract the coordinates from a GeoPosition object:

Out[1]=1
Out[2]=2

Extract latitude, longitude or both, as Quantity angles:

Out[3]=3
Out[4]=4
Out[5]=5

Use properties to extract information from a GeoPosition object:

Out[1]=1
Out[2]=2
Out[3]=3

Use properties to extract information from a GeoPosition array:

Out[1]=1

There are 200 points:

Out[2]=2

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

Out[3]=3

Each point has dimension 2, namely latitude and longitude:

Out[4]=4

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

Out[5]=5

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

Out[6]=6
Out[7]=7

Generalizations & Extensions  (3)Generalized and extended use cases

Use positions on a sphere of 100 kilometers of radius:

Out[1]=1

Convert to a 3D vector:

Out[2]=2

The vector components are given in meters:

Out[3]=3

Transform back to a GeoPosition object on the sphere:

Out[4]=4

Use positions on an ellipsoid of given semiaxes:

Out[1]=1

Convert to a 3D vector:

Out[2]=2

Transform back to a GeoPosition object on the ellipsoid:

Out[3]=3

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

Out[1]=1

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

Out[2]=2

Computations are performed with an ellipsoid of these semiaxis lengths:

Out[3]=3

Applications  (3)Sample problems that can be solved with this function

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

Out[1]=1
Out[2]=2

Compute distance between two points:

Out[3]=3

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

Out[4]=4

Draw the geodesic between them and respective geo circles:

Out[5]=5

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

Out[6]=6

Geographical locations returned by EntityValue are given as GeoPosition objects:

Out[1]=1

They can also include height and time information:

Out[2]=2

Geographical polygons have their coordinates inside a GeoPosition head:

Out[1]=1

Draw the polygon or its boundary:

Out[2]=2

Properties & Relations  (7)Properties of the function, and connections to other functions

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

Out[1]=1
Out[2]=2

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

Out[3]=3

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

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

Out[2]=2

Convert it to Cartesian coordinates:

Out[3]=3

Convert back to geodetic coordinates:

Out[4]=4

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

Out[5]=5
Out[6]=6

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

Out[7]=7
Out[7]=7

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

Out[8]=8

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

Out[9]=9

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

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

Convert back to a GeoPosition specification:

Out[5]=5

The antipode of a GeoPosition object is another GeoPosition object:

Out[1]=1
Out[2]=2

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

Out[1]=1

It contains zero positions:

Out[2]=2

GeoPosition[] is invalid syntax:

Out[3]=3

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

Out[2]=2

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

Out[2]=2

Possible Issues  (2)Common pitfalls and unexpected behavior

Degree is considered as any other numeric expression:

Out[1]=1

Use Quantity to denote that angles are given in radians:

Out[2]=2

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

Out[1]=1

Neat Examples  (1)Surprising or curious use cases

Take a list of images with Exif location information:

Extract their respective positions:

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

Out[3]=3
Wolfram Research (2008), GeoPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoPosition.html (updated 2019).
Wolfram Research (2008), GeoPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoPosition.html (updated 2019).

Text

Wolfram Research (2008), GeoPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoPosition.html (updated 2019).

Wolfram Research (2008), GeoPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoPosition.html (updated 2019).

CMS

Wolfram Language. 2008. "GeoPosition." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/GeoPosition.html.

Wolfram Language. 2008. "GeoPosition." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/GeoPosition.html.

APA

Wolfram Language. (2008). GeoPosition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GeoPosition.html

Wolfram Language. (2008). GeoPosition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GeoPosition.html

BibTeX

@misc{reference.wolfram_2025_geoposition, author="Wolfram Research", title="{GeoPosition}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/GeoPosition.html}", note=[Accessed: 26-March-2025 ]}

@misc{reference.wolfram_2025_geoposition, author="Wolfram Research", title="{GeoPosition}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/GeoPosition.html}", note=[Accessed: 26-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_geoposition, organization={Wolfram Research}, title={GeoPosition}, year={2019}, url={https://reference.wolfram.com/language/ref/GeoPosition.html}, note=[Accessed: 26-March-2025 ]}

@online{reference.wolfram_2025_geoposition, organization={Wolfram Research}, title={GeoPosition}, year={2019}, url={https://reference.wolfram.com/language/ref/GeoPosition.html}, note=[Accessed: 26-March-2025 ]}