GeoDistanceList[{loc1,loc2,…,locn}]
返回地点的连续对之间的测地距离列表.
GeoDistanceList
GeoDistanceList[{loc1,loc2,…,locn}]
返回地点的连续对之间的测地距离列表.
更多信息和选项
- GeoDistanceList[{loc1,…,locn}] 中的地点 loci 可以以度数为单位的 {lat,lon} 对象、GeoPosition 对象、地理 Entity 对象或者地点的任意其它指定给出.
- 结果返回以长度为维度的 QuantityArray 对象. 所用单位可以按照选项 UnitSystem 选择,默认值为 $UnitSystem.
- 如果地点的输入列表长度为 n,距离的所得列表长度为 n-1.
- GeoDistanceList 具有选项 DistanceFunction,另外有下列设置:
-
"Boundary" 区域中任意两点之间的最小距离 "Center" 区域中心之间的距离 "SignedBoundary" 内部点与边界的距离,负值 - GeoDistanceList 默认使用设置 DistanceFunction->"Center". 这是与 GeoDistance 使用的不同默认值.
范例
打开所有单元 关闭所有单元基本范例 (1)
GeoDistanceList[{Entity["City", {"BuenosAires", "BuenosAires", "Argentina"}], Entity["City", {"RioDeJaneiro", "RioDeJaneiro", "Brazil"}], Entity["City", {"MexicoCity", "DistritoFederal", "Mexico"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]把 QuantityArray 对象转化为规范格式:
Normal[%]GeoGraphics[{Red, Thick, GeoPath[{Entity["City", {"BuenosAires", "BuenosAires", "Argentina"}], Entity["City", {"RioDeJaneiro", "RioDeJaneiro", "Brazil"}], Entity["City", {"MexicoCity", "DistritoFederal", "Mexico"}], Entity["City", {"NewYork", "NewYork", "UnitedStates"}]}]}]范围 (3)
GeoDistanceList[{{0, 0}, {10.5, -22.9}, {10, 150.9}}]//NormalGeoDistanceList[{{"46°25'12''N", "21°1'12''W"}, {"30°13'48.''S", "40°30'36.''E"}, {"40d20m12s N", "112d50m W"}}]//Normal或以 Quantity 角度的形式给出::
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"]}}]//Normal使用 GeoPosition 对象:
GeoDistanceList[{GeoPosition[{0, 0}], GeoPosition[{10, -30}], GeoPosition[{-70, 170}]}]//NormalGeoDistanceList[GeoPosition[{{0, 0}, {10, -30}, {-70, 170}}]]//NormalGeoDistanceList[{GeoPosition[{0, 0}], GeoPositionXYZ[{5.19*^6, 3.00*^6, 2.20*^6}], GeoGridPosition[{1, 1}, "Albers"]}]//Normal使用 Entity 对象:
GeoDistanceList[{Entity["City", {"Lisbon", "Lisboa", "Portugal"}], Entity["City", {"Madrid", "Madrid", "Spain"}], Entity["City", {"Paris", "IleDeFrance", "France"}], Entity["City", {"Vienna", "Vienna", "Austria"}]}]//Normal选项 (2)
DistanceFunction (1)
GeoDistanceList[{Entity["Country", "Spain"], Entity["Country", "Germany"], Entity["Country", "Norway"]}]//Normal% == GeoDistanceList[{Entity["Country", "Spain"], Entity["Country", "Germany"], Entity["Country", "Norway"]}, DistanceFunction -> "Center"]GeoDistanceList[{Entity["Country", "Spain"], Entity["Country", "Germany"], Entity["Country", "Norway"]}, DistanceFunction -> "Boundary"]//NormalUnitSystem (1)
结果的默认单位由 $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"]//Normal属性和关系 (3)
GeoDistanceList 基本上等价于 Subsequences 和 GeoDistance 的混合:
locs = {GeoPosition[{0, 0}], GeoPosition[{20, 10}], GeoPosition[{40, -10}]}GeoDistance@@@Subsequences[locs, {2}]% == GeoDistanceList[locs]GeoDistanceList 报告距离. TravelDistanceList 按照道路报告距离:
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}] 返回空列表:
GeoDistanceList[{Here}]GeoDistanceList[{}] 未定义:
GeoDistanceList[{}]可能存在的问题 (1)
选项 DistanceFunction 的默认值对于 GeoDistance 是 "Boundary",但是对于 GeoDistanceList 是 "Center":
Options[GeoDistance, DistanceFunction]Options[GeoDistanceList, DistanceFunction]GeoDistanceList[{Entity["Country", "Mexico"], Entity["Country", "UnitedStates"], Entity["Country", "Canada"]}, DistanceFunction -> "Center"]//NormalGeoDistanceList[{Entity["Country", "Mexico"], Entity["Country", "UnitedStates"], Entity["Country", "Canada"]}, DistanceFunction -> "Boundary"]//Normal文本
Wolfram Research (2016),GeoDistanceList,Wolfram 语言函数,https://reference.wolfram.com/language/ref/GeoDistanceList.html.
CMS
Wolfram 语言. 2016. "GeoDistanceList." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/GeoDistanceList.html.
APA
Wolfram 语言. (2016). GeoDistanceList. Wolfram 语言与系统参考资料中心. 追溯自 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: 03-November-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: 03-November-2026]}