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

> Returns a Series of dtype('bool') with value True if the DE-9IM relationship between each geometry and other matches the specified pattern.

Returns a `Series` of `dtype('bool')` with value `True` if the
DE-9IM relationship between each geometry and `other` matches the
specified `pattern`.

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

## Signature

```python theme={"system"}
relate_pattern(other, pattern, align=None) -> pspd.Series
```

## Parameters

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

<ParamField path="pattern" type="str" required>
  The DE-9IM pattern to match. A 9-character string where each
  character is one of: 'T' (matches any non-empty intersection),
  'F' (matches empty intersection), '\*' (matches anything),
  '0', '1', '2' (matches specific dimensions).
</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="Series(bool)" />

<Note>
  This method works in a row-wise manner.
</Note>

**See also**

* `GeoSeries.relate`
* `GeoSeries.contains`
* `GeoSeries.intersects`

## Examples

```python theme={"system"}
>>> from sedona.spark.geopandas import GeoSeries
>>> from shapely.geometry import Point, Polygon
>>> s = GeoSeries(
...     [
...         Polygon([(0, 0), (2, 0), (2, 2), (0, 2)]),
...         Polygon([(0, 0), (2, 0), (2, 2), (0, 2)]),
...     ]
... )
>>> s2 = GeoSeries(
...     [
...         Point(1, 1),
...         Point(3, 3),
...     ]
... )
```

```python theme={"system"}
>>> s.relate_pattern(s2, "T*F**FFF*")
0     True
1    False
dtype: bool
```


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