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

Performs a DBSCAN clustering across the entire dataframe.

Returns a struct containing the cluster ID and a boolean indicating if the record is a core point in the cluster.

* `epsilon` is the maximum distance between two points for them to be considered as part of the same cluster.
* `minPoints` is the minimum number of neighbors a single record must have to form a cluster.
* `useSpheroid` is whether to use ST\_DistanceSpheroid or ST\_Distance as the distance metric.

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_DBSCAN/ST_DBSCAN.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=e647b3357839c399fbecc4f02ae11333" alt="ST_DBSCAN" width="400" height="170" data-path="images/sql-functions/ST_DBSCAN/ST_DBSCAN.svg" />

## Signatures

```sql theme={"system"}
ST_DBSCAN(geom: Geometry, epsilon: Double, minPoints: Integer, useSpheroid: Boolean)
```

## Parameters

<ParamField body="geom" type="Geometry" required>
  The input geometry.
</ParamField>

<ParamField body="epsilon" type="Double" required>
  The maximum distance between two points to be considered in the same cluster.
</ParamField>

<ParamField body="minPoints" type="Integer" required>
  The minimum number of points to form a cluster.
</ParamField>

<ParamField body="useSpheroid" type="Boolean" required>
  Whether to use spheroidal distance calculation.
</ParamField>

## Return type

<ResponseField type="Struct<isCore: Boolean, cluster: Long>">
  A struct containing the result fields.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_DBSCAN(geom, 1.0, 2, False)
```

```
{true, 85899345920}
```
