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

# ST_DWithin (Python)

> Check if geometry a is within 'distance' units of geometry b :param a: Geometry column to check :param b: Geometry column to check :param distance: distance units to check the within predicate...

Check if geometry a is within 'distance' units of geometry b

SQL reference: [`ST_DWithin`](/reference/wherobots-db/geometry-data/predicates/ST_DWithin)

## Signature

```python theme={"system"}
from sedona.spark.sql.st_predicates import ST_DWithin

ST_DWithin(
    a: ColumnOrName,
    b: ColumnOrName,
    distance: Union[ColumnOrName, float],
    use_sphere: Optional[Union[ColumnOrName, bool]] = None,
)
```

## Parameters

<ParamField path="a" type="ColumnOrName" required>
  Geometry column to check
</ParamField>

<ParamField path="b" type="ColumnOrName" required>
  Geometry column to check
</ParamField>

<ParamField path="distance" type="Union[ColumnOrName, float]" required>
  distance units to check the within predicate
</ParamField>

<ParamField path="use_sphere" type="Optional[Union[ColumnOrName, bool]]" default="None">
  whether to use spheroid distance or euclidean distance
</ParamField>

## Returns

<ResponseField name="return">
  True if a is within distance units of Geometry b
</ResponseField>


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