# Datasets ## List all datasets `$ plaza datasets list` **get** `/api/v1/datasets` List all datasets ### Returns - `dataset_list: object { datasets }` List of all available datasets. - `datasets: array of Dataset` Array of dataset metadata objects - `id: string` Dataset UUID - `inserted_at: string` Creation timestamp (UTC) - `name: string` Human-readable dataset name - `slug: string` URL-friendly identifier - `updated_at: string` Last update timestamp (UTC) - `attribution: optional string` Required attribution text - `description: optional string` Dataset description - `license: optional string` License identifier (e.g. CC-BY-4.0) - `source_url: optional string` URL of the original data source ### Example ```cli plaza datasets list \ --api-key 'My API Key' ``` #### Response ```json { "datasets": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "inserted_at": "2019-12-27T18:11:19.117Z", "name": "NYC Bike Lanes", "slug": "nyc-bike-lanes", "updated_at": "2019-12-27T18:11:19.117Z", "attribution": "attribution", "description": "description", "license": "license", "source_url": "https://example.com" } ] } ``` ## Create a new dataset (admin only) `$ plaza datasets create` **post** `/api/v1/datasets` Create a new dataset (admin only) ### Parameters - `--name: string` Human-readable dataset name - `--slug: string` URL-friendly identifier (lowercase, hyphens, no spaces) - `--attribution: optional string` Required attribution text - `--description: optional string` Dataset description - `--license: optional string` License identifier (e.g. CC-BY-4.0) - `--source-url: optional string` Source data URL ### Returns - `dataset: object { id, inserted_at, name, 6 more }` Metadata for a custom dataset. Datasets contain user-uploaded geospatial features separate from the OSM data. - `id: string` Dataset UUID - `inserted_at: string` Creation timestamp (UTC) - `name: string` Human-readable dataset name - `slug: string` URL-friendly identifier - `updated_at: string` Last update timestamp (UTC) - `attribution: optional string` Required attribution text - `description: optional string` Dataset description - `license: optional string` License identifier (e.g. CC-BY-4.0) - `source_url: optional string` URL of the original data source ### Example ```cli plaza datasets create \ --api-key 'My API Key' \ --name 'NYC Bike Lanes' \ --slug nyc-bike-lanes ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "inserted_at": "2019-12-27T18:11:19.117Z", "name": "NYC Bike Lanes", "slug": "nyc-bike-lanes", "updated_at": "2019-12-27T18:11:19.117Z", "attribution": "attribution", "description": "description", "license": "license", "source_url": "https://example.com" } ``` ## Get dataset by ID `$ plaza datasets retrieve` **get** `/api/v1/datasets/{id}` Get dataset by ID ### Parameters - `--id: string` Dataset ID ### Returns - `dataset: object { id, inserted_at, name, 6 more }` Metadata for a custom dataset. Datasets contain user-uploaded geospatial features separate from the OSM data. - `id: string` Dataset UUID - `inserted_at: string` Creation timestamp (UTC) - `name: string` Human-readable dataset name - `slug: string` URL-friendly identifier - `updated_at: string` Last update timestamp (UTC) - `attribution: optional string` Required attribution text - `description: optional string` Dataset description - `license: optional string` License identifier (e.g. CC-BY-4.0) - `source_url: optional string` URL of the original data source ### Example ```cli plaza datasets retrieve \ --api-key 'My API Key' \ --id id ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "inserted_at": "2019-12-27T18:11:19.117Z", "name": "NYC Bike Lanes", "slug": "nyc-bike-lanes", "updated_at": "2019-12-27T18:11:19.117Z", "attribution": "attribution", "description": "description", "license": "license", "source_url": "https://example.com" } ``` ## Delete a dataset `$ plaza datasets delete` **delete** `/api/v1/datasets/{id}` Delete a dataset ### Parameters - `--id: string` Dataset ID ### Example ```cli plaza datasets delete \ --api-key 'My API Key' \ --id id ``` ## Query features in a dataset `$ plaza datasets features` **get** `/api/v1/datasets/{id}/features` Query features in a dataset ### Parameters - `--id: string` Dataset ID - `--cursor: optional string` Cursor for pagination - `--limit: optional number` Maximum results - `--output-buffer: optional number` Buffer geometry by meters - `--output-centroid: optional boolean` Replace geometry with centroid - `--output-fields: optional string` Comma-separated property fields to include - `--output-geometry: optional boolean` Include geometry (default true) - `--output-include: optional string` Extra computed fields: bbox, distance, center - `--output-precision: optional number` Coordinate decimal precision (1-15, default 7) - `--output-simplify: optional number` Simplify geometry tolerance in meters - `--output-sort: optional string` Sort by: distance, name, osm_id ### Returns - `feature_collection: object { features, type }` GeoJSON FeatureCollection (RFC 7946). For paginated endpoints, metadata is returned in HTTP response headers rather than the body: | Header | Description | | --------------- | ------------------------------------------------ | | `X-Limit` | Requested result limit | | `X-Has-More` | `true` if more results exist | | `X-Next-Cursor` | Opaque cursor for next page (cursor pagination) | | `X-Next-Offset` | Numeric offset for next page (offset pagination) | | `Link` | RFC 8288 `rel="next"` link to the next page | Content-Type is `application/geo+json`. - `features: array of GeoJsonFeature` Array of GeoJSON Feature objects - `geometry: object { coordinates, type }` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: array of number or array of array of number or array of array of array of number or array of array of array of array of number` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `Point: array of number` [longitude, latitude] or [longitude, latitude, elevation] - `LineString or MultiPoint: array of array of number` Array of [lng, lat] positions - `Polygon or MultiLineString: array of array of array of number` Array of linear rings / line strings - `MultiPolygon: array of array of array of array of number` Array of polygons - `type: "Point" or "LineString" or "Polygon" or 3 more` Geometry type - `"Point"` - `"LineString"` - `"Polygon"` - `"MultiPoint"` - `"MultiLineString"` - `"MultiPolygon"` - `properties: map[unknown]` OSM tags flattened as key-value pairs, plus `@type` (node/way/relation) and `@id` (OSM ID) metadata fields. May include `distance_m` for proximity queries. - `type: "Feature"` Always `Feature` - `"Feature"` - `id: optional string` Compound identifier in `type/osm_id` format - `type: "FeatureCollection"` Always `FeatureCollection` - `"FeatureCollection"` ### Example ```cli plaza datasets features \ --api-key 'My API Key' \ --id id ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "@id": "bar", "@type": "bar", "amenity": "bar", "cuisine": "bar", "name": "bar" }, "type": "Feature", "id": "node/21154906" } ], "type": "FeatureCollection" } ``` ## Domain Types ### Dataset - `dataset: object { id, inserted_at, name, 6 more }` Metadata for a custom dataset. Datasets contain user-uploaded geospatial features separate from the OSM data. - `id: string` Dataset UUID - `inserted_at: string` Creation timestamp (UTC) - `name: string` Human-readable dataset name - `slug: string` URL-friendly identifier - `updated_at: string` Last update timestamp (UTC) - `attribution: optional string` Required attribution text - `description: optional string` Dataset description - `license: optional string` License identifier (e.g. CC-BY-4.0) - `source_url: optional string` URL of the original data source ### Dataset List - `dataset_list: object { datasets }` List of all available datasets. - `datasets: array of Dataset` Array of dataset metadata objects - `id: string` Dataset UUID - `inserted_at: string` Creation timestamp (UTC) - `name: string` Human-readable dataset name - `slug: string` URL-friendly identifier - `updated_at: string` Last update timestamp (UTC) - `attribution: optional string` Required attribution text - `description: optional string` Dataset description - `license: optional string` License identifier (e.g. CC-BY-4.0) - `source_url: optional string` URL of the original data source