> ## 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.

# GeoSeries.get_geometry

> Returns the n-th geometry from a collection of geometries (0-indexed).

Returns the n-th geometry from a collection of geometries (0-indexed).

If the index is non-negative, it returns the geometry at that index.
If the index is negative, it counts backward from the end of the collection (e.g., -1 returns the last geometry).
Returns None if the index is out of bounds.

Note: Simple geometries act as length-1 collections

Note: Using Shapely \< 2.0, may lead to different results for empty simple geometries due to how
shapely interprets them.

## Signature

```python theme={"system"}
get_geometry(index) -> GeoSeries
```

## Parameters

<ParamField path="index" type="int or array_like" required>
  Position of a geometry to be retrieved within its collection
</ParamField>

## Returns

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

<Note>
  Simple geometries act as collections of length 1. Any out-of-range index value
  returns None.
</Note>

## Examples

```python theme={"system"}
>>> from shapely.geometry import Point, MultiPoint, GeometryCollection
>>> s = geopandas.GeoSeries(
...     [
...         Point(0, 0),
...         MultiPoint([(0, 0), (1, 1), (0, 1), (1, 0)]),
...         GeometryCollection(
...             [MultiPoint([(0, 0), (1, 1), (0, 1), (1, 0)]), Point(0, 1)]
...         ),
...         Polygon(),
...         GeometryCollection(),
...     ]
... )
>>> s
0                                          POINT (0 0)
1              MULTIPOINT ((0 0), (1 1), (0 1), (1 0))
2    GEOMETRYCOLLECTION (MULTIPOINT ((0 0), (1 1), ...
3                                        POLYGON EMPTY
4                             GEOMETRYCOLLECTION EMPTY
dtype: geometry
```

```python theme={"system"}
>>> s.get_geometry(0)
0                                POINT (0 0)
1                                POINT (0 0)
2    MULTIPOINT ((0 0), (1 1), (0 1), (1 0))
3                              POLYGON EMPTY
4                                       None
dtype: geometry
```

```python theme={"system"}
>>> s.get_geometry(1)
0           None
1    POINT (1 1)
2    POINT (0 1)
3           None
4           None
dtype: geometry
```

```python theme={"system"}
>>> s.get_geometry(-1)
0    POINT (0 0)
1    POINT (1 0)
2    POINT (0 1)
3  POLYGON EMPTY
4           None
dtype: geometry
```


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