---
title: "GeoLength"
language: "en"
type: "Symbol"
summary: "GeoLength[g] gives the length of the geo path g."
keywords: 
- geo length
- geographic length
- geo path length
- geo curve length
- geo distance
- geodesic length
- loxodrome length
- rhumb line length
- departure
canonical_url: "https://reference.wolfram.com/language/ref/GeoLength.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Geodesy"
    link: "https://reference.wolfram.com/language/guide/Geodesy.en.md"
  - 
    title: "Maps & Cartography"
    link: "https://reference.wolfram.com/language/guide/MapsAndCartography.en.md"
related_functions: 
  - 
    title: "GeoDistance"
    link: "https://reference.wolfram.com/language/ref/GeoDistance.en.md"
  - 
    title: "GeoDistanceList"
    link: "https://reference.wolfram.com/language/ref/GeoDistanceList.en.md"
  - 
    title: "ArcLength"
    link: "https://reference.wolfram.com/language/ref/ArcLength.en.md"
  - 
    title: "GeoArea"
    link: "https://reference.wolfram.com/language/ref/GeoArea.en.md"
  - 
    title: "Quantity"
    link: "https://reference.wolfram.com/language/ref/Quantity.en.md"
  - 
    title: "GeoPath"
    link: "https://reference.wolfram.com/language/ref/GeoPath.en.md"
  - 
    title: "GeoBoundary"
    link: "https://reference.wolfram.com/language/ref/GeoBoundary.en.md"
  - 
    title: "GeoCircle"
    link: "https://reference.wolfram.com/language/ref/GeoCircle.en.md"
  - 
    title: "GeoBoundsRegionBoundary"
    link: "https://reference.wolfram.com/language/ref/GeoBoundsRegionBoundary.en.md"
  - 
    title: "GeoHemisphereBoundary"
    link: "https://reference.wolfram.com/language/ref/GeoHemisphereBoundary.en.md"
  - 
    title: "GeoVisibleRegionBoundary"
    link: "https://reference.wolfram.com/language/ref/GeoVisibleRegionBoundary.en.md"
related_tutorials: 
  - 
    title: "GeoGraphics"
    link: "https://reference.wolfram.com/language/tutorial/GeoGraphics.en.md"
---
# 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 (13)

### Basic Examples (4)

Compute the total length of a geo path on the Earth:

```wl
In[1]:= GeoLength[GeoPath[{Entity["City", {"NewYork", "NewYork", "UnitedStates"}], Entity["City", {"Chicago", "Illinois", "UnitedStates"}], Entity["City", {"Toronto", "Ontario", "Canada"}]}]]

Out[1]= Quantity[1159.8294630322225, "Miles"]
```

---

Compute the total length of a path formed by geodesic segments:

```wl
In[1]:= GeoLength[GeoPath[{{0, 0}, {0, 40}, {40, 70}}]]

Out[1]= Quantity[6105.97585791728, "Miles"]
```

Compute the total length of the rhumb lines joining the same points:

```wl
In[2]:= GeoLength[GeoPath[{{0, 0}, {0, 40}, {40, 70}}, "RhumbLine"]]

Out[2]= Quantity[6111.167059303452, "Miles"]
```

---

Length of the Earth's equator:

```wl
In[1]:= GeoLength[GeoPath["Equator"]]

Out[1]= Quantity[24901.460896848952, "Miles"]
```

Length of a full meridian:

```wl
In[2]:= 2GeoLength[GeoPath["PrimeMeridian"]]

Out[2]= Quantity[24859.733479555565, "Miles"]
```

---

Compute the perimeter of a geo disk:

```wl
In[1]:= GeoLength[GeoCircle[Entity["City", {"London", "GreaterLondon", "UnitedKingdom"}], Quantity[500, "Miles"]]]

Out[1]= Quantity[3133.2776040763447, "Miles"]
```

### Scope (3)

Compute the length of different one-dimensional geo elements:

```wl
In[1]:= GeoLength[GeoPath[{{0, 0}, {40, 30}, {20, -10}}]]

Out[1]= Quantity[6072.339433495231, "Miles"]

In[2]:= GeoLength[GeoCircle[{0, 0}, Quantity[500, "Miles"]]]

Out[2]= Quantity[3133.2095489363473, "Miles"]

In[3]:= GeoLength[DayNightTerminator[DateObject[{2015, 12, 21}]]]

Out[3]= Quantity[24866.37592283172, "Miles"]

In[4]:= GeoLength[GeoHemisphereBoundary[Here]]

Out[4]= Quantity[24876.997896811146, "Miles"]
```

---

Length of the perimeter of a region with holes, as a single joined object:

```wl
In[1]:=
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}}];

In[2]:= g = JoinedCurve[{{outer}, {inner1}, {inner2}}];

In[3]:= GeoGraphics[{Red, g}]

Out[3]= [image]

In[4]:= GeoLength[g]

Out[4]= Quantity[30575.81362380393, "Miles"]
```

It can also be obtained by adding the lengths of the outer and inner curves:

```wl
In[5]:= GeoLength[outer] + GeoLength[inner1] + GeoLength[inner2]

Out[5]= Quantity[30575.81362380393, "Miles"]
```

---

Paths of different types can be combined with ``GeoGroup`` :

```wl
In[1]:=
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"}]}];

In[2]:= GeoLength[GeoGroup[{g1, g2}]]

Out[2]= Quantity[4915.341221747185, "Miles"]

In[3]:= % == Total[GeoLength[{g1, g2}]]

Out[3]= True
```

### Generalizations & Extensions (1)

``GeoLength[Line[{p1, p2, …}]]`` is equivalent to ``GeoLength[GeoPath[{p1, p2, …}]]`` for geo locations ``pi`` :

```wl
In[1]:= GeoLength[Line[GeoPosition[{{0, 0}, {0, 40}, {40, 70}}]]]

Out[1]= Quantity[6105.97585791728, "Miles"]

In[2]:= % == GeoLength[GeoPath[{{0, 0}, {0, 40}, {40, 70}}]]

Out[2]= True
```

### Options (2)

#### UnitSystem (1)

Use the units determined by the value of ``\$UnitSystem`` :

```wl
In[1]:= $UnitSystem

Out[1]= "Imperial"

In[2]:= GeoLength[GeoPath["NorthernTropic"]]

Out[2]= Quantity[22859.219868472403, "Miles"]
```

Specify the unit system to use:

```wl
In[3]:= GeoLength[GeoPath["NorthernTropic"], UnitSystem -> "Metric"]

Out[3]= Quantity[36788.34834000685, "Kilometers"]
```

#### GeoModel (1)

Length of a geo path on the Earth:

```wl
In[1]:=
g = GeoPath[{{10, 40}, {20, 50}, {-40, 120}}];
GeoLength[g]

Out[1]= Quantity[7064.395810227721, "Miles"]
```

Length of the corresponding path on Mars:

```wl
In[2]:= GeoLength[g, GeoModel -> "Mars"]

Out[2]= Quantity[3754.6175205296854, "Miles"]
```

### Applications (2)

Compute the length of the boundary of a country from its polygon:

```wl
In[1]:= GeoLength[GeoBoundary[Entity["Country", "Spain"]["Polygon"]]]

Out[1]= Quantity[4014.753603939431, "Miles"]
```

That value is shorter than the actual length of the boundary, due to approximations in the polygon:

```wl
In[2]:= Entity["Country", "Spain"]["BoundaryLength"]

Out[2]= Quantity[4276.214407858109, "Miles"]
```

---

The length of a segment of parallel, or the projection on a parallel of any geo path, is called departure:

```wl
In[1]:= GeoLength[GeoPath[{"Parallel", 38, {0, 5}}]]

Out[1]= Quantity[272.88280515268525, "Miles"]
```

Express it in nautical miles:

```wl
In[2]:= UnitConvert[%, "NauticalMiles"]

Out[2]= Quantity[237.12867450088723, "NauticalMiles"]
```

### Properties & Relations (1)

For a geo path defined by a list of points, ``GeoLength[GeoPath[list]]`` is equivalent to ``GeoDistance[list]`` :

```wl
In[1]:= list = RandomReal[{-90, 90}, {10, 2}]

Out[1]= {{8.85956, 24.5283}, {54.3463, 53.9451}, {-58.1838, 52.5296}, {-50.818, -14.0151}, {-57.5593, -63.6563}, {61.8156, -20.4106}, {31.6636, 13.6522}, {82.1434, 53.2884}, {-72.0694, -53.4474}, {67.9236, 33.2725}}

In[2]:= GeoLength[GeoPath[list]]

Out[2]= Quantity[52319.51545870635, "Miles"]

In[3]:= % == GeoDistance[list]

Out[3]= True
```

## See Also

* [`GeoDistance`](https://reference.wolfram.com/language/ref/GeoDistance.en.md)
* [`GeoDistanceList`](https://reference.wolfram.com/language/ref/GeoDistanceList.en.md)
* [`ArcLength`](https://reference.wolfram.com/language/ref/ArcLength.en.md)
* [`GeoArea`](https://reference.wolfram.com/language/ref/GeoArea.en.md)
* [`Quantity`](https://reference.wolfram.com/language/ref/Quantity.en.md)
* [`GeoPath`](https://reference.wolfram.com/language/ref/GeoPath.en.md)
* [`GeoBoundary`](https://reference.wolfram.com/language/ref/GeoBoundary.en.md)
* [`GeoCircle`](https://reference.wolfram.com/language/ref/GeoCircle.en.md)
* [`GeoBoundsRegionBoundary`](https://reference.wolfram.com/language/ref/GeoBoundsRegionBoundary.en.md)
* [`GeoHemisphereBoundary`](https://reference.wolfram.com/language/ref/GeoHemisphereBoundary.en.md)
* [`GeoVisibleRegionBoundary`](https://reference.wolfram.com/language/ref/GeoVisibleRegionBoundary.en.md)

## Tech Notes

* [GeoGraphics](https://reference.wolfram.com/language/tutorial/GeoGraphics.en.md)

## Related Guides

* [`Geodesy`](https://reference.wolfram.com/language/guide/Geodesy.en.md)
* [Maps & Cartography](https://reference.wolfram.com/language/guide/MapsAndCartography.en.md)

## Related Links

* [An Elementary Introduction to the Wolfram Language: Geocomputation](https://www.wolfram.com/language/elementary-introduction/18-geocomputation.html)

## History

* [Introduced in 2016 (10.4)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn104.en.md)