> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GeoDataFrame.shortest_line

> Returns the shortest line between each geometry in the GeoSeries and other.

Returns the shortest line between each geometry in the `GeoSeries`
and `other`.

The resulting line starts on this geometry and ends on `other`.

The operation works on a 1-to-1 row-wise manner:

## Signature

```python theme={"system"}
shortest_line(other, align=None)
```

## Parameters

<ParamField path="other" type="GeoSeries or geometric object" required>
  The GeoSeries (elementwise) or geometric object to find the
  shortest line to.
</ParamField>

<ParamField path="align" type="bool | None (default None)" default="None">
  If True, automatically aligns GeoSeries based on their indices. None defaults to True.
  If False, the order of elements is preserved.
</ParamField>

## Returns

<ResponseField name="return" type="GeoSeries" />

## Examples

```python theme={"system"}
>>> from sedona.spark.geopandas import GeoSeries
>>> from shapely.geometry import Point, LineString
>>> s1 = GeoSeries(
...     [
...         Point(0, 0),
...         LineString([(0, 0), (1, 0)]),
...     ]
... )
>>> s2 = GeoSeries(
...     [
...         Point(1, 1),
...         Point(0, 1),
...     ]
... )
>>> s1.shortest_line(s2, align=False)
0    LINESTRING (0 0, 1 1)
1    LINESTRING (0 0, 0 1)
dtype: geometry
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.