# /geojson

## geojson data.

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

Request a geojson collection for the given viewport.

#### Query Parameters

| Name   | Type   | Description                              |
| ------ | ------ | ---------------------------------------- |
| locale | string | The locale key.                          |
| layer  | string | The layer key.                           |
| table  | string | The PostGIS table.                       |
| 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 in themes.      |
| filter | string | The theme type (categorized, graduated). |
| token  | string | Required for private endpoints.          |

{% tabs %}
{% tab title="200 Array of geojson features." %}
```javascript
[
  {
    "type": "Feature",
    "geometry": {
      "type": "MultiPolygon",
      "coordinates": [
        [
          [
            [
              -2.04831614791702,
              52.599116590136
            ],
            [...]
          ]
        ]
      ]
    },
    "properties": {
      "id": 259,
      "cat": "61059"
    }
  },
  {...}
]
```
{% endtab %}

{% tab title="406 Query with 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 %}

