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

Returns a `weights` column containing every record in a dataframe within a specified `threshold` distance.

The `weights` column is an array of structs containing the `attributes` from each neighbor and that neighbor's weight. Since this is a binary distance band function, weights of neighbors within the threshold will always be
`1.0`.

## Signatures

```sql theme={"system"}
ST_BinaryDistanceBandColumn(geometry:Geometry, threshold: Double, includeZeroDistanceNeighbors: boolean, includeSelf: boolean, useSpheroid: boolean, attributes: Struct)
```

## Parameters

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

<ParamField body="threshold" type="Double" required>
  The maximum distance threshold for including neighbors.
</ParamField>

<ParamField body="includeZeroDistanceNeighbors" type="Boolean" required>
  Whether to include neighbors at zero distance.
</ParamField>

<ParamField body="includeSelf" type="Boolean" required>
  Whether to include the record itself as its own neighbor.
</ParamField>

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

<ParamField body="attributes" type="Struct" required>
  The struct of attribute columns to include from each neighbor.
</ParamField>

## Return type

<ResponseField type="Array<Struct<neighbor: Integer, value: Double>>">
  A struct containing the result fields.
</ResponseField>

## Examples

```sql theme={"system"}
ST_BinaryDistanceBandColumn(geometry, 1.0, true, true, false, struct(id, geometry))
```

```sql theme={"system"}
{% raw %}
[{{15, POINT (3 1.9)}, 1.0}, {{16, POINT (3 2)}, 1.0}, {{17, POINT (3 2.1)}, 1.0}, {{18, POINT (3 2.2)}, 1.0}]
{% endraw %}
```
