# /cluster

## cluster data array.

<mark style="color:blue;">`GET`</mark> `geolytix.xyz/api/layer/cluster`

Request an array of cluster locations for the given view port.

#### Query Parameters

| Name   | Type   | Description                                             |
| ------ | ------ | ------------------------------------------------------- |
| locale | string | The locale key.                                         |
| layer  | string | The layer key.                                          |
| table  | string | The PostGIS table with cluster locations.               |
| kmeans | string | The factor for the PostGIS kmeans algorithm.            |
| dbscan | string | The factor for the PostGIS dbscan algorithm.            |
| west   | string | The western bounds of the view port.                    |
| south  | string | The southern bounds of the view port.                   |
| east   | string | The eastern bounds of the view port.                    |
| north  | string | The northern bounds of the view port.                   |
| cat    | string | The cat field to be used for cluster aggregation.       |
| size   | string | The size field to be used for cluster aggregation.      |
| theme  | string | The theme type (categorized, graduated, competition).   |
| filter | string | Stringified filter object to be applied to table query. |
| token  | string | Required for private endpoints.                         |

{% tabs %}
{% tab title="200 An array of features with coordinates of the cluster location and properties that describe the cluster." %}
```javascript
[
  {
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [
        -4.94003973494868,
        50.3960153464407
      ]
    },
    "properties": {
      "count": 112,
      "size": 112,
      "cat": null
    }
  },
  {...}
  }
```
{% endtab %}

{% tab title="406 Missing or invalid parameter." %}
```
'Invalid locale.'

'Invalid layer.'

'Missing table.'

'Invalid parameter.'
```
{% endtab %}

{% tab title="500 Please check backend error logs for more details." %}
```
'Failed to query PostGIS table.'
```
{% endtab %}
{% endtabs %}

