GeoDistance

GeoDistance[{lat1,lon1},{lat2,lon2}]
gives the geodesic distance between latitude-longitude positions on the Earth.

GeoDistance[loc1,loc2]
gives the distance between locations specified by position objects or geographical entities.

GeoDistance[{loc1,,locn}]
gives the total distance from to through all the intermediate .

Details and OptionsDetails and Options

  • GeoDistance[loc1,loc2] gives the distance between locations and as measured along the geodesic joining them on the surface of the reference ellipsoid. Heights are ignored.
  • The result is returned as a Quantity object with dimensions of length. The unit used can be chosen with the option UnitSystem, which has $UnitSystem as default value.
  • Latitudes and longitudes can be given as numbers in degrees, as DMS strings, or as Quantity angles.
  • Position objects in GeoDistance[loc1,loc2] can be given as GeoPosition, GeoPositionXYZ, GeoPositionENU, or GeoGridPosition objects.
  • In GeoDistance[loc1,loc2], the can be Entity objects with domains such as , , and .
  • For entities corresponding to extended geographic regions, GeoDistance by default computes the minimum distance between any points in the regions.
  • GeoDistance[loc1,loc2] by default uses the reference ellipsoid associated with the datum for .
  • GeoDistance and GeoDirection solve the geodetic inverse problem.
  • GeoDistance has option DistanceFunction, with the following settings:
  • "Boundary"minimum distance between any points in regions
    "Center"distance between centers of regions
    "SignedBoundary"distance to boundary, negative for interior points
  • GeoDistance by default uses the setting DistanceFunction->"Boundary".

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Distance between two positions on the reference ellipsoid:

In[1]:=
Click for copyable input
Out[1]=

Distance between two cities:

In[1]:=
Click for copyable input
Out[1]=

Distance between two fully specified geodetic positions:

In[1]:=
Click for copyable input
Out[1]=

Total distance between several locations:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2008
(7.0)
| Updated in 2014
(10.0)
Translate this page: