WOLFRAM

GeoDistanceList[{loc1,loc2,,locn}]

returns the list of geodesic distances between consecutive pairs of locations.

Details and Options

  • The locations loci in GeoDistanceList[{loc1,,locn}] can be given as pairs {lat,lon} in degrees, GeoPosition objects, geographic Entity objects, or any other specification of a location.
  • The result is returned as a QuantityArray object with dimensions of length. The unit used can be chosen with the option UnitSystem, which has $UnitSystem as its default value.
  • If the input list of locations has length n, the resulting list of distances has length n-1.
  • GeoDistanceList 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
  • GeoDistanceList by default uses the setting DistanceFunction->"Center". This is a different default from the one for GeoDistance.

Examples

open allclose all

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

List of consecutive geodesic distances between cities:

Out[1]=1

Convert the QuantityArray object to its normal form:

Out[2]=2

Draw the three geodesic segments on a map:

Out[3]=3

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

Specify locations as pairs {lat,lon} in degrees:

Out[1]=1

Latitude and longitude can also be given as DMS strings:

Out[2]=2

Or as Quantity angles:

Out[3]=3

Use GeoPosition objects:

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

Use other forms of geodetic position:

Out[3]=3

Use Entity objects:

Out[1]=1

Options  (2)Common values & functionality for each option

DistanceFunction  (1)

For extended entities, the distances are computed between center points by default:

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

Compute the minimum distance between respective boundaries:

Out[3]=3

UnitSystem  (1)

The default unit of the result is determined by the value of $UnitSystem:

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

Change to a different system:

Out[3]=3

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

GeoDistanceList is basically equivalent to a combination of Subsequences and GeoDistance:

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

GeoDistanceList reports geodesic distance. TravelDistanceList reports distance by road:

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

GeoDistanceList[{loc}] returns an empty list:

Out[1]=1

GeoDistanceList[{}] is not defined:

Out[2]=2

Possible Issues  (1)Common pitfalls and unexpected behavior

The default value of the option DistanceFunction is "Boundary" for GeoDistance, but "Center" for GeoDistanceList:

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

The default choice "Center" computes distances between centers:

Out[3]=3

The choice "Boundary" gives zero distance for neighboring countries:

Out[4]=4
Wolfram Research (2016), GeoDistanceList, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoDistanceList.html.
Wolfram Research (2016), GeoDistanceList, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoDistanceList.html.

Text

Wolfram Research (2016), GeoDistanceList, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoDistanceList.html.

Wolfram Research (2016), GeoDistanceList, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoDistanceList.html.

CMS

Wolfram Language. 2016. "GeoDistanceList." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GeoDistanceList.html.

Wolfram Language. 2016. "GeoDistanceList." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GeoDistanceList.html.

APA

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

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

BibTeX

@misc{reference.wolfram_2025_geodistancelist, author="Wolfram Research", title="{GeoDistanceList}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/GeoDistanceList.html}", note=[Accessed: 16-April-2025 ]}

@misc{reference.wolfram_2025_geodistancelist, author="Wolfram Research", title="{GeoDistanceList}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/GeoDistanceList.html}", note=[Accessed: 16-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_geodistancelist, organization={Wolfram Research}, title={GeoDistanceList}, year={2016}, url={https://reference.wolfram.com/language/ref/GeoDistanceList.html}, note=[Accessed: 16-April-2025 ]}

@online{reference.wolfram_2025_geodistancelist, organization={Wolfram Research}, title={GeoDistanceList}, year={2016}, url={https://reference.wolfram.com/language/ref/GeoDistanceList.html}, note=[Accessed: 16-April-2025 ]}