GeoPath[{loc1,loc2},pathtype]
是一个 GeoGraphics 基元,表示位置 loc1 和 loc2 之间类型为 pathtype 的路径.
GeoPath[{loc1,loc2,…},pathtype]
表示一个路径,通过连接连续位置 loci 之间类型为 pathtype 的路径形成.
GeoPath[{loc1,d,α},pathtype]
表示一个路径,以初始方位角 α 从位置 loc1 移动距离 d 得到.
GeoPath[{{loc11,loc12,…},{loc21,…},…},pathtype]
表示类型为 pathtype 的路径的不相交集合.
GeoPath
GeoPath[{loc1,loc2},pathtype]
是一个 GeoGraphics 基元,表示位置 loc1 和 loc2 之间类型为 pathtype 的路径.
GeoPath[{loc1,loc2,…},pathtype]
表示一个路径,通过连接连续位置 loci 之间类型为 pathtype 的路径形成.
GeoPath[{loc1,d,α},pathtype]
表示一个路径,以初始方位角 α 从位置 loc1 移动距离 d 得到.
GeoPath[{{loc11,loc12,…},{loc21,…},…},pathtype]
表示类型为 pathtype 的路径的不相交集合.
更多信息和选项
- 位置 loci 可以用以度为单位的纬度和经度坐标 {lat,lon} 指定,如 GeoPosition[{lat,lon}],或作为命名实体 Entity[…] 指定.
- 实体将按照由它们的 "Position" 属性确定的位置解释.
- GeoPath 支持地理路径类型:
-
"Geodesic" 点之间的测地路径 "Rhumb","RhumbLine","Loxodrome" 点之间的常数带路径 "GreatEllipse","GreatCircle" 通过地球中心的平面上的路径 - GeoPath[{loc1,…}] 表示类型为 "Geodesic" 的路径.
- 对于 "Geodesic" 路径中的多个位置 loci,每一对连续位置由测地线连接,但完整的路径通常不会是测地线. 这对于其他路径类型同样适用.
- 距离为 di 且分别具有初始方位角 αi 的多步组合可以使用GeoPath[{loc1,GeoDisplacement[{d1,α1}],GeoDisplacement[{d2,α2}],…},pathtype] 表示.
- 长路径一般不在地图上笔直出现.
- 特别命名的地理路径包括:
-
GeoPath[{"Parallel",lat}] 与纬度 lat 平行,经度延长 360° GeoPath[{"Meridian",lon}] 经度 lon 的子午线,纬度延长 180° GeoPath[{"Parallel",lat,{lon1,lon2}}] 与纬度 lat 平行,从经度 lon1 到 lon2 GeoPath[{"Meridian",lon,{lat1,lat2}}] 经度 lon 的子午线,从纬度 lat1 到 lat2 GeoPath["Equator"] 与纬度 0° 平行 GeoPath["NorthernTropic"] 与纬度 23.4374° 平行 GeoPath["SouthernTropic"] 与纬度 -23.4373° 平行 GeoPath["ArcticCircle"] 与纬度 66.5622° 平行 GeoPath["AntarcticCircle"] 与纬度 -66.5622° 平行 GeoPath["GreenwichMeridian"] 经度 0° 的子午线 GeoPath["DateLineMeridian"] 经度 180° 的子午线 GeoPath["DateLine"] 国际日期线 - 线的粗细可以使用 Thickness 或 AbsoluteThickness 指定,也可以使用 Thick 和 Thin.
- 点化线或虚线可以使用 Dashing 或 AbsoluteDashing 指定,也可以使用 Dashed、Dotted 等.
- 线的阴影或着色可以使用 CMYKColor、GrayLevel、Hue、Opacity 或 RGBColor 指定.
- 选项 VertexColors->{c1,c2,…} 可用于指定线条颜色通过对各点指定的颜色 ci 之间内插得到.
- 线段的连接可以使用 JoinForm 指定.
- 线帽可以使用 CapForm 指定.
范例
打开所有单元 关闭所有单元基本范例 (5)
GeoGraphics[GeoPath[{{-35, -55}, {70, 100}}], GeoRange -> "World", Frame -> True]GeoGraphics[GeoPath[{GeoPosition[{-33, -55}], GeoPosition[{70, 100}]}, "Rhumb"], GeoRange -> "World"]GeoGraphics[Arrow@GeoPath[{Entity["City", {"NewYork", "NewYork", "UnitedStates"}], 500000, -120}, "Geodesic"]]GeoGraphics[{Red, GeoPath[{Entity["City", {"Portland", "Oregon", "UnitedStates"}], Entity["City", {"Orlando", "Florida", "UnitedStates"}]}, "Rhumb"]}]GeoGraphics[{Red, GeoPath[{Entity["City", {"Portland", "Oregon", "UnitedStates"}], Entity["City", {"Orlando", "Florida", "UnitedStates"}], Entity["City", {"Boston", "Massachusetts", "UnitedStates"}]}, "Geodesic"]}]范围 (8)
GeoGraphics[{Red, GeoPath[{{25, -80}, GeoPosition[{42, -88}], Entity["City", {"LosAngeles", "California", "UnitedStates"}]}]}]GeoGraphics[{Red, GeoPath[{GeoPosition[{-30, -50}], GeoDisplacement[{Quantity[5000, "Kilometers"], "NorthWest"}]}]}]GeoGraphics[{Red, GeoPath[{GeoPosition[{0, 0}], GeoDisplacement[{1000000, 40}], GeoDisplacement[{500000, -30}], GeoDisplacement[{8000000, -120}], GeoDisplacement[{2000000, 0}]}, "Rhumb"]}]GeoGraphics[{Red, GeoPath[{"Parallel", 40}], Blue, GeoPath[{"Parallel", 10}], Orange, GeoPath[{"Parallel", -40}]}]GeoGraphics[{Red, GeoPath[{"Meridian", -50}], Blue, GeoPath[{"Meridian", 100}]}, GeoRange -> "World", GeoProjection -> "Bonne"]GeoGraphics[{Arrow@GeoPath[{"Parallel", 40, {-170, 140}}], Arrow@GeoPath[{"Parallel", -30, {170, -140}}]}, GeoRange -> "World"]GeoGraphics[{Red, GeoPath["Equator"], Orange, GeoPath["NorthernTropic"], GeoPath["SouthernTropic"], Blue, GeoPath["ArcticCircle"], GeoPath["AntarcticCircle"], Green, GeoPath["GreenwichMeridian"], GeoPath["DateLineMeridian"]}, GeoProjection -> "WinkelTripel"]GeoGraphics[{Red, GeoPath["DateLine"]}, GeoRange -> {All, {90, 270}}, GeoGridLines -> Quantity[15, "AngularDegrees"], Frame -> True]选项 (3)
VertexColors (2)
GeoGraphics[GeoPath[{{-70, -70}, {20, 40}}, VertexColors -> {Blue, Red}]]GeoGraphics[GeoPath[Flatten[{GeoPosition[{0, 0}], Table[GeoDisplacement[{10^6, RandomReal[{0, 360}]}], {70}]}], VertexColors -> Table[Hue[(i/100)], {i, 0, 70}]]]应用 (3)
在 "LambertAzimuthal" 投影中具有测地边的地理三角形:
geotriangle = FilledCurve[{GeoPath[{{0, 0}, {0, 90}, {90, 0}, {0, 0}}]}];GeoGraphics[geotriangle, GeoProjection -> "LambertAzimuthal", GeoRange -> "World"]在 "Equirectangular" 投影中的同一地理三角形:
GeoGraphics[geotriangle, GeoProjection -> "Equirectangular", GeoRange -> "World"]GeoGraphics[geotriangle, GeoProjection -> "Bonne", GeoRange -> "World"]位移数据相同但初始位置不同的多个路径. 使用 Arrow:
GeoGraphics[Table[{Hue[(lat + 90) / 180], Arrow[GeoPath[{{lat, -90}, GeoDisplacement[{10 ^ 7, 30}]}]]}, {lat, -90, 90, 10}]]创建工具提示条,使得坐标能从作为地理路径绘制的地理网格线上读取:
GeoGraphics[{Red, Table[Tooltip[GeoPath[{"Parallel", lat}], Row[{"lat = ", lat, °}]], {lat, -90, 90, 15}], Orange, Table[Tooltip[GeoPath[{"Meridian", lon}], Row[{"lon = ", lon, °}]], {lon, -180, 180, 30}]}, GeoProjection -> "Bonne"]属性和关系 (5)
p = GeoPosition[{-80, -50}];
q = GeoPosition[{80, 50}];使用缺省的 equirectangular 地理投影,恒向线(红色)和测地线(绿色)均不是直线(为便于比较,用黑色给出):
GeoGraphics[{Line[{p, q}], Red, GeoPath[{p, q}, "Rhumb"], Green, GeoPath[{p, q}, "Geodesic"]}, GeoRange -> "World"]恒向线在 Mercator 投影中是笔直的,现在它叠加在黑线上:
GeoGraphics[{Line[{p, q}], Red, GeoPath[{p, q}, "Rhumb"], Green, GeoPath[{p, q}, "Geodesic"]}, GeoRange -> "World", GeoProjection -> "Mercator"]测地线在中心为其中一点的方位投影中是笔直的,现在它叠加在黑线上:
{GeoGraphics[{Line[{p, q}], Red, GeoPath[{p, q}, "Rhumb"], Green, GeoPath[{p, q}, "Geodesic"]}, GeoRange -> "World", GeoProjection -> {"LambertAzimuthal", "Centering" -> p}], GeoGraphics[{Line[{p, q}], Red, GeoPath[{p, q}, "Rhumb"], Green, GeoPath[{p, q}, "Geodesic"]}, GeoRange -> "World", GeoProjection -> {"LambertAzimuthal", "Centering" -> q}]}Graphics3D[gc = N[PolyhedronData["Dodecahedron", "GraphicsComplex"]], Boxed -> False, Method -> {"ShrinkWrap" -> True}, ImageSize -> Small]points = Most /@ First[GeoPosition[GeoPositionXYZ[gc[[1]], Norm[gc[[1, 1]]]]]]GeoGraphics[GeoPath[Extract[points, List /@ gc[[2, 1]]]], GeoRange -> "World"]GeoGraphics[GeoPath[Extract[points, List /@ gc[[2, 1]]]], GeoRange -> "World", GeoProjection -> "LambertAzimuthal"]center = GeoPosition[{50, 0}];
radius = 4000000;GeoGraphics[{Red, GeoCircle[center, radius], Blue, Table[GeoPath[{center, GeoDisplacement[{radius, bearing}]}], {bearing, -180, 180, 30}]}]测地路径的端点可以使用 GeoDestination 计算:
p = GeoPosition[{40, -120}];
c = GeoDisplacement[{4000000, 100}];GeoGraphics[{GeoPath[{p, c}], Entity["Country", "UnitedStates"]}, Frame -> True]q = GeoDestination[p, c]使用 GeoDistance 和 GeoDirection 检查路径的位移数据:
{GeoDistance[p, q], GeoDirection[p, q]}或直接使用 GeoDisplacement:
GeoDisplacement[p, q]city = Entity["City", {"Rome", "Lazio", "Italy"}];
r = Quantity[6367470., "Meters"];
course = GeoDisplacement[{6Pi r, "NE"}, "Geodesic"]默认情况下,计算在一个椭圆形的地球上进行. 因此,测地路径不闭合:
GeoGraphics[Arrow@GeoPath[{city, course}], GeoCenter -> city, GeoRange -> Quantity[150, "Kilometers"]]GeoGraphics[Arrow@GeoPath[{city, course}], GeoCenter -> city, GeoRange -> Quantity[150, "Kilometers"], GeoModel -> r]course = GeoDisplacement[{6Pi r, "NE"}, "GreatEllipse"]GeoGraphics[Arrow@GeoPath[{city, course}], GeoCenter -> city, GeoRange -> Quantity[150, "Kilometers"]]互动范例 (1)
Manipulate[GeoGraphics[{PointSize[0.02], Point[GeoPosition[{lat1, lon1}]], Point[GeoPosition[{lat2, lon2}]], Red, GeoPath[{{lat1, lon1}, {lat2, lon2}}, "Loxodrome"], Green, GeoPath[{{lat1, lon1}, {lat2, lon2}}, "Geodesic"]}, GeoRange -> "World"], {{lat1, 45}, -90, 90}, {{lon1, -80}, -180, 180}, {{lat2, -30}, -90, 90}, {{lon2, 80}, -180, 180}]巧妙范例 (3)
start = EntityValue[Entity["Building", "TourEiffel"], EntityProperty["Building", "Position"]];
course = {GeoDisplacement[{10^5, 0}], GeoDisplacement[{10^5, 90}], GeoDisplacement[{10^5, 180}], GeoDisplacement[{10^5, -90}]};GraphicsRow[Apply[GeoGraphics[{Red, PointSize[Large], Point[start], Darker[Green], Thickness[Large], Arrow@GeoPath[{start, course}, "Geodesic"]}, ##1]&, {{}, {GeoCenter -> start, GeoRange -> Quantity[2, "Miles"]}}, {1}]]GeoDistance[start, Last[GeoDestination[start, course]]]GraphicsRow[Apply[GeoGraphics[{Red, PointSize[Large], Point[start], Darker[Green], Thickness[Large], Arrow@GeoPath[{start, course}, "Loxodrome"]}, ##1]&, {{}, {GeoCenter -> start, GeoRange -> Quantity[2, "Miles"]}}, {1}]]从宙斯神庙沿一条路径移动,该路径由
的连分数的前3141项给出:
start = Entity["Building", "TempleZeusOlympia"];
gclist = GeoDisplacement[{1000#, #}]& /@ ContinuedFraction[Pi, 3141];end = Last@GeoDestination[start, gclist]First[GeoNearest["City", end]]GeoDistance[end, %]GeoGraphics[{Blue, PointSize[Large], Point[start], Yellow, GeoPath[{start, gclist}]}]研究在地球上进行六角形平铺的候选方案. 从丹佛以100英里的步长递归移动:
p0 = GeoPosition[Entity["City", {"Denver", "Colorado", "UnitedStates"}]]d = Quantity[100, "Miles"]对于每条初始方位角为
的测地线,绘制方位角分别为
和
的两条新测地线:
newConnections[{GeoPath[{p1_, p2_}], {d_, α0_}}] := Table[{GeoPath[{p2, GeoDestination[p2, {d, α}]}], {d, α}}, {α, {α0 - 60, α0 + 60}}];
newConnections[list_List] := Flatten[newConnections /@ list, 1];pathList = Cases[NestList[newConnections, Table[{GeoPath[{p0, GeoDestination[p0, {d, α}]}], {d, α}}, {α, {0, 120, 240}}], 8], _GeoPath, Infinity];GeoGraphics[{Thin, Opacity[0.4], pathList}, ImageSize -> Medium, GeoBackground -> "Plain"]技术笔记
相关链接
文本
Wolfram Research (2014),GeoPath,Wolfram 语言函数,https://reference.wolfram.com/language/ref/GeoPath.html.
CMS
Wolfram 语言. 2014. "GeoPath." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/GeoPath.html.
APA
Wolfram 语言. (2014). GeoPath. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/GeoPath.html 年
BibTeX
@misc{reference.wolfram_2026_geopath, author="Wolfram Research", title="{GeoPath}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/GeoPath.html}", note=[Accessed: 03-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_geopath, organization={Wolfram Research}, title={GeoPath}, year={2014}, url={https://reference.wolfram.com/language/ref/GeoPath.html}, note=[Accessed: 03-November-2026]}