GeoDistanceList[{loc1,loc2,…,locn}]
returns the list of geodesic distances between consecutive pairs of locations.
GeoDistanceList
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 all close allBasic Examples (1)
List of consecutive geodesic distances between cities:
GeoDistanceList[{Entity["City", {"BuenosAires", "BuenosAires", "Argentina"}], Entity["City", {"RioDeJaneiro", "RioDeJaneiro", "Brazil"}], Entity["City", {"MexicoCity", "DistritoFederal", "Mexico"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]Convert the QuantityArray object to its normal form:
Normal[%]Draw the three geodesic segments on a map:
GeoGraphics[{Red, Thick, GeoPath[{Entity["City", {"BuenosAires", "BuenosAires", "Argentina"}], Entity["City", {"RioDeJaneiro", "RioDeJaneiro", "Brazil"}], Entity["City", {"MexicoCity", "DistritoFederal", "Mexico"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]}]Scope (3)
Specify locations as pairs {lat,lon} in degrees:
GeoDistanceList[{{0, 0}, {10.5, -22.9}, {10, 150.9}}]//NormalLatitude and longitude can also be given as DMS strings:
GeoDistanceList[{{"46°25'12''N", "21°1'12''W"}, {"30°13'48.''S", "40°30'36.''E"}, {"40d20m12s N", "112d50m W"}}]//NormalOr as Quantity angles:
GeoDistanceList[{{Quantity[0, "AngularDegrees"], Quantity[1, "Radians"]}, {Quantity[MixedMagnitude[{10, 5, 0}], MixedUnit[{"AngularDegrees", "Arcminutes", "Arcseconds"}]], Quantity[-21.02, "AngularDegrees"]}, {Quantity[-30.233, "AngularDegrees"], Quantity[40.5, "AngularDegrees"]}}]//NormalUse GeoPosition objects:
GeoDistanceList[{GeoPosition[{0, 0}], GeoPosition[{10, -30}], GeoPosition[{-70, 170}]}]//NormalGeoDistanceList[GeoPosition[{{0, 0}, {10, -30}, {-70, 170}}]]//NormalUse other forms of geodetic position:
GeoDistanceList[{GeoPosition[{0, 0}], GeoPositionXYZ[{5.19*^6, 3.00*^6, 2.20*^6}], GeoGridPosition[{1, 1}, "Albers"]}]//NormalUse Entity objects:
GeoDistanceList[{Entity["City", {"Lisbon", "Lisboa", "Portugal"}], Entity["City", {"Madrid", "Madrid", "Spain"}], Entity["City", {"Paris", "IleDeFrance", "France"}], Entity["City", {"Vienna", "Vienna", "Austria"}]}]//NormalOptions (2)
DistanceFunction (1)
For extended entities, the distances are computed between center points by default:
GeoDistanceList[{Entity["Country", "Spain"], Entity["Country", "Germany"], Entity["Country", "Norway"]}]//Normal% == GeoDistanceList[{Entity["Country", "Spain"], Entity["Country", "Germany"], Entity["Country", "Norway"]}, DistanceFunction -> "Center"]Compute the minimum distance between respective boundaries:
GeoDistanceList[{Entity["Country", "Spain"], Entity["Country", "Germany"], Entity["Country", "Norway"]}, DistanceFunction -> "Boundary"]//NormalUnitSystem (1)
The default unit of the result is determined by the value of $UnitSystem:
$UnitSystemGeoDistanceList[{Entity["City", {"SanFrancisco", "California", "UnitedStates"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]//NormalGeoDistanceList[{Entity["City", {"SanFrancisco", "California", "UnitedStates"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}, UnitSystem -> "Metric"]//NormalProperties & Relations (3)
GeoDistanceList is basically equivalent to a combination of Subsequences and GeoDistance:
locs = {GeoPosition[{0, 0}], GeoPosition[{20, 10}], GeoPosition[{40, -10}]}GeoDistance@@@Subsequences[locs, {2}]% == GeoDistanceList[locs]GeoDistanceList reports geodesic distance. TravelDistanceList reports distance by road:
GeoDistanceList[{Entity["City", {"SanFrancisco", "California", "UnitedStates"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]//NormalTravelDistanceList[{Entity["City", {"SanFrancisco", "California", "UnitedStates"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]//NormalGeoDistanceList[{loc}] returns an empty list:
GeoDistanceList[{Here}]GeoDistanceList[{}] is not defined:
GeoDistanceList[{}]Possible Issues (1)
The default value of the option DistanceFunction is "Boundary" for GeoDistance, but "Center" for GeoDistanceList:
Options[GeoDistance, DistanceFunction]Options[GeoDistanceList, DistanceFunction]The default choice "Center" computes distances between centers:
GeoDistanceList[{Entity["Country", "Mexico"], Entity["Country", "UnitedStates"], Entity["Country", "Canada"]}, DistanceFunction -> "Center"]//NormalThe choice "Boundary" gives zero distance for neighboring countries:
GeoDistanceList[{Entity["Country", "Mexico"], Entity["Country", "UnitedStates"], Entity["Country", "Canada"]}, DistanceFunction -> "Boundary"]//NormalRelated Guides
History
Text
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.
APA
Wolfram Language. (2016). GeoDistanceList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GeoDistanceList.html
BibTeX
@misc{reference.wolfram_2026_geodistancelist, author="Wolfram Research", title="{GeoDistanceList}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/GeoDistanceList.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_geodistancelist, organization={Wolfram Research}, title={GeoDistanceList}, year={2016}, url={https://reference.wolfram.com/language/ref/GeoDistanceList.html}, note=[Accessed: 12-June-2026]}