GeoLength[g]
gives the length of the geo path g.
GeoLength
GeoLength[g]
gives the length of the geo path g.
Details and Options
- The path g in GeoLength[g] can be any one-dimensional geo primitive, such as GeoPath, GeoCircle, or GeoVisibleRegionBoundary.
- GeoLength[GeoPath[{p1,p2,…}]] computes the length of the path formed by geodesic segments joining the locations pi.
- JoinedCurve and GeoGroup can be used to combine multiple paths.
- GeoLength[g] returns a Quantity object with units of length.
- GeoLength[{g1,g2,…}] gives {GeoLength[g1],GeoLength[g2],…}.
- Possible options of GeoLength include:
-
GeoModel Automatic model of the Earth or celestial body UnitSystem $UnitSystem unit system to use in the result
Examples
open all close allBasic Examples (4)
Compute the total length of a geo path on the Earth:
GeoLength[GeoPath[{Entity["City", {"NewYork", "NewYork", "UnitedStates"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}], Entity["City", {"Toronto", "Ontario", "Canada"}]}]]Compute the total length of a path formed by geodesic segments:
GeoLength[GeoPath[{{0, 0}, {0, 40}, {40, 70}}]]Compute the total length of the rhumb lines joining the same points:
GeoLength[GeoPath[{{0, 0}, {0, 40}, {40, 70}}, "RhumbLine"]]Length of the Earth's equator:
GeoLength[GeoPath["Equator"]]2GeoLength[GeoPath["PrimeMeridian"]]Compute the perimeter of a geo disk:
GeoLength[GeoCircle[Entity["City", {"London", "GreaterLondon", "UnitedKingdom"}], Quantity[500, "Miles"]]]Scope (3)
Compute the length of different one-dimensional geo elements:
GeoLength[GeoPath[{{0, 0}, {40, 30}, {20, -10}}]]GeoLength[GeoCircle[{0, 0}, Quantity[500, "Miles"]]]GeoLength[DayNightTerminator[DateObject[{2015, 12, 21}]]]GeoLength[GeoHemisphereBoundary[Here]]Length of the perimeter of a region with holes, as a single joined object:
outer = GeoPath[{{0, 0}, {40, 0}, {40, 100}, {0, 100}, {0, 0}}];
inner1 = GeoPath[{{10, 10}, {30, 10}, {30, 40}, {10, 40}, {10, 10}}];
inner2 = GeoPath[{{10, 60}, {30, 60}, {30, 90}, {10, 90}, {10, 60}}];g = JoinedCurve[{{outer}, {inner1}, {inner2}}];GeoGraphics[{Red, g}]GeoLength[g]It can also be obtained by adding the lengths of the outer and inner curves:
GeoLength[outer] + GeoLength[inner1] + GeoLength[inner2]Paths of different types can be combined with GeoGroup:
g1 = GeoCircle[Entity["City", {"NewYork", "NewYork", "UnitedStates"}], Quantity[600, "Miles"]];
g2 = GeoPath[{Entity["City", {"NewYork", "NewYork", "UnitedStates"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}], Entity["City", {"Toronto", "Ontario", "Canada"}]}];GeoLength[GeoGroup[{g1, g2}]]% == Total[GeoLength[{g1, g2}]]Generalizations & Extensions (1)
Options (2)
UnitSystem (1)
Use the units determined by the value of $UnitSystem:
$UnitSystemGeoLength[GeoPath["NorthernTropic"]]Specify the unit system to use:
GeoLength[GeoPath["NorthernTropic"], UnitSystem -> "Metric"]Applications (2)
Compute the length of the boundary of a country from its polygon:
GeoLength[GeoBoundary[Entity["Country", "Spain"]["Polygon"]]]That value is shorter than the actual length of the boundary, due to approximations in the polygon:
Entity["Country", "Spain"]["BoundaryLength"]The length of a segment of parallel, or the projection on a parallel of any geo path, is called departure:
GeoLength[GeoPath[{"Parallel", 38, {0, 5}}]]UnitConvert[%, "NauticalMiles"]Properties & Relations (1)
For a geo path defined by a list of points, GeoLength[GeoPath[list]] is equivalent to GeoDistance[list]:
list = RandomReal[{-90, 90}, {10, 2}]GeoLength[GeoPath[list]]% == GeoDistance[list]Tech Notes
Related Guides
History
Text
Wolfram Research (2016), GeoLength, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoLength.html.
CMS
Wolfram Language. 2016. "GeoLength." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GeoLength.html.
APA
Wolfram Language. (2016). GeoLength. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GeoLength.html
BibTeX
@misc{reference.wolfram_2026_geolength, author="Wolfram Research", title="{GeoLength}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/GeoLength.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_geolength, organization={Wolfram Research}, title={GeoLength}, year={2016}, url={https://reference.wolfram.com/language/ref/GeoLength.html}, note=[Accessed: 13-June-2026]}