Skip to content

Collections Endpoints

Method URL Description
GET /api/v1/collections Collections
GET /api/v1/collections/{name} Feature Collection
GET /api/v1/collections/{name}/items Features
GET /api/v1/collections/{name}/items/{id} Feature

Endpoint Description's

Collections

Collection endpoint returns a list of all available tables to query.

Collections endpoint is available at /api/v1/collections

curl http://localhost:8000/api/v1/collections

Example Response

[
    {
        "id": "data.public.zip_centroids",
        "title": "zip_centroids",
        "description": "zip_centroids",
        "keywords": [
            "zip_centroids"
        ],
        "links": [
            {
                "type": "application/json",
                "rel": "self",
                "title": "This document as JSON",
                "href": "http://127.0.0.1:8000/api/v1/collections/data.public.zip_centroids"
            }
        ],
        "extent": {
            "spatial": {
                "bbox": [
                    -180,
                    -90,
                    180,
                    90
                ],
                "crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
            }
        },
        "itemType": "feature"
    },
  {},...

Feature Collection

Feature Collection endpoint returns information about a single table.

Collections endpoint is available at /api/v1/collections/{item}

curl http://localhost:8000/api/v1/collections/data.public.zip_centroids

Example Response

{
    "id": "data.public.zip_centroids",
    "title": "data.public.zip_centroids",
    "description": "data.public.zip_centroids",
    "keywords": [
        "data.public.zip_centroids"
    ],
    "links": [
        {
            "type": "application/json",
            "rel": "self",
            "title": "Items as GeoJSON",
            "href": "http://127.0.0.1:8000/api/v1/collections/data.public.zip_centroids/items"
        }
    ],
    "extent": {
        "spatial": {
            "bbox": [
                -180,
                -90,
                180,
                90
            ],
            "crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
        }
    },
    "itemType": "feature"
}

Features

Features endpoint returns a geojson feature collection for a feature collection.

Collections endpoint is available at /api/v1/collections/{item}/items

curl http://localhost:8000/api/v1/collections/data.public.states/items

Parameters

  • bbox=mix,miny,maxx,maxy - filter features in response to ones intersecting a bounding box (in lon/lat or specified CRS). Ex. 17,-48,69,-161
  • <propname>=val - filter features for a property having a value. Multiple property filters are ANDed together.
  • filter=cql-expr - filters features via a CQL expression.
  • properties=PROP-LIST- return only specific properties (comma-separated). If PROP-LIST is empty, no properties are returned. If not present, all properties are returned.dinates to use N decimal places
  • sortby=PROP[A|D] - sort the response items by a property (ascending (default) or descending).
  • limit=N - limits the number of features in the response.
  • offset=N - starts the response at an offset.
  • srid=srid_number - The srid number for data. Default is 4326.

Example Response

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "MultiPolygon",
                "coordinates": [
                    ...
                ]
            },
            "properties": {
                "gid": 5,
                "state_name": "Nevada",
                "state_fips": "32",
                "sub_region": "Mountain",
                "state_abbr": "NV",
                "population": 2994047
            }
        },
        ...
    ]
}

Feature

Feature endpoint returns a geojson feature collection for a single feature in a feature collection.

Collections endpoint is available at /api/v1/collections/{item}/items/{id}

curl http://localhost:8000/api/v1/collections/data.public.states/items/5

Parameters

  • properties=PROP-LIST- return only specific properties (comma-separated). If PROP-LIST is empty, no properties are returned. If not present, all properties are returned.

Example Response

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "MultiPolygon",
                "coordinates": [
                    ...
                ]
            },
            "properties": {
                "gid": 5,
                "state_name": "Nevada",
                "state_fips": "32",
                "sub_region": "Mountain",
                "state_abbr": "NV",
                "population": 2994047
            }
        }
    ]
}