# Datasets ## List all datasets `DatasetList datasets().list(DatasetListParamsparams = DatasetListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/datasets` List all datasets ### Parameters - `DatasetListParams params` ### Returns - `class DatasetList:` List of all available datasets. - `List datasets` Array of dataset metadata objects - `String id` Dataset UUID - `LocalDateTime insertedAt` Creation timestamp (UTC) - `String name` Human-readable dataset name - `String slug` URL-friendly identifier - `LocalDateTime updatedAt` Last update timestamp (UTC) - `Optional attribution` Required attribution text - `Optional description` Dataset description - `Optional license` License identifier (e.g. CC-BY-4.0) - `Optional sourceUrl` URL of the original data source ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.datasets.DatasetList; import com.plazafyi.models.datasets.DatasetListParams; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); DatasetList datasetList = client.datasets().list(); } } ``` #### 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) `Dataset datasets().create(DatasetCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/datasets` Create a new dataset (admin only) ### Parameters - `DatasetCreateParams params` - `String name` Human-readable dataset name - `String slug` URL-friendly identifier (lowercase, hyphens, no spaces) - `Optional attribution` Required attribution text - `Optional description` Dataset description - `Optional license` License identifier (e.g. CC-BY-4.0) - `Optional sourceUrl` Source data URL ### Returns - `class Dataset:` Metadata for a custom dataset. Datasets contain user-uploaded geospatial features separate from the OSM data. - `String id` Dataset UUID - `LocalDateTime insertedAt` Creation timestamp (UTC) - `String name` Human-readable dataset name - `String slug` URL-friendly identifier - `LocalDateTime updatedAt` Last update timestamp (UTC) - `Optional attribution` Required attribution text - `Optional description` Dataset description - `Optional license` License identifier (e.g. CC-BY-4.0) - `Optional sourceUrl` URL of the original data source ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.datasets.Dataset; import com.plazafyi.models.datasets.DatasetCreateParams; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); DatasetCreateParams params = DatasetCreateParams.builder() .name("NYC Bike Lanes") .slug("nyc-bike-lanes") .build(); Dataset dataset = client.datasets().create(params); } } ``` #### 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 `Dataset datasets().retrieve(DatasetRetrieveParamsparams = DatasetRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/datasets/{id}` Get dataset by ID ### Parameters - `DatasetRetrieveParams params` - `Optional id` ### Returns - `class Dataset:` Metadata for a custom dataset. Datasets contain user-uploaded geospatial features separate from the OSM data. - `String id` Dataset UUID - `LocalDateTime insertedAt` Creation timestamp (UTC) - `String name` Human-readable dataset name - `String slug` URL-friendly identifier - `LocalDateTime updatedAt` Last update timestamp (UTC) - `Optional attribution` Required attribution text - `Optional description` Dataset description - `Optional license` License identifier (e.g. CC-BY-4.0) - `Optional sourceUrl` URL of the original data source ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.datasets.Dataset; import com.plazafyi.models.datasets.DatasetRetrieveParams; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); Dataset dataset = client.datasets().retrieve("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 `datasets().delete(DatasetDeleteParamsparams = DatasetDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **delete** `/api/v1/datasets/{id}` Delete a dataset ### Parameters - `DatasetDeleteParams params` - `Optional id` ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.datasets.DatasetDeleteParams; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); client.datasets().delete("id"); } } ``` ## Query features in a dataset `FeatureCollection datasets().features(DatasetFeaturesParamsparams = DatasetFeaturesParams.none(), RequestOptionsrequestOptions = RequestOptions.none())` **get** `/api/v1/datasets/{id}/features` Query features in a dataset ### Parameters - `DatasetFeaturesParams params` - `Optional id` - `Optional cursor` Cursor for pagination - `Optional limit` Maximum results - `Optional outputBuffer` Buffer geometry by meters - `Optional outputCentroid` Replace geometry with centroid - `Optional outputFields` Comma-separated property fields to include - `Optional outputGeometry` Include geometry (default true) - `Optional outputInclude` Extra computed fields: bbox, distance, center - `Optional outputPrecision` Coordinate decimal precision (1-15, default 7) - `Optional outputSimplify` Simplify geometry tolerance in meters - `Optional outputSort` Sort by: distance, name, osm_id ### Returns - `class FeatureCollection:` 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`. - `List features` Array of GeoJSON Feature objects - `GeoJsonGeometry geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `Coordinates coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `List` - `List>` - `List>>` - `List>>>` - `Type type` Geometry type - `POINT("Point")` - `LINE_STRING("LineString")` - `POLYGON("Polygon")` - `MULTI_POINT("MultiPoint")` - `MULTI_LINE_STRING("MultiLineString")` - `MULTI_POLYGON("MultiPolygon")` - `Properties properties` 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 type` Always `Feature` - `FEATURE("Feature")` - `Optional id` Compound identifier in `type/osm_id` format - `Type type` Always `FeatureCollection` - `FEATURE_COLLECTION("FeatureCollection")` ### Example ```java package com.plazafyi.example; import com.plazafyi.client.PlazaClient; import com.plazafyi.client.okhttp.PlazaOkHttpClient; import com.plazafyi.models.FeatureCollection; import com.plazafyi.models.datasets.DatasetFeaturesParams; public final class Main { private Main() {} public static void main(String[] args) { PlazaClient client = PlazaOkHttpClient.fromEnv(); FeatureCollection featureCollection = client.datasets().features("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 - `class Dataset:` Metadata for a custom dataset. Datasets contain user-uploaded geospatial features separate from the OSM data. - `String id` Dataset UUID - `LocalDateTime insertedAt` Creation timestamp (UTC) - `String name` Human-readable dataset name - `String slug` URL-friendly identifier - `LocalDateTime updatedAt` Last update timestamp (UTC) - `Optional attribution` Required attribution text - `Optional description` Dataset description - `Optional license` License identifier (e.g. CC-BY-4.0) - `Optional sourceUrl` URL of the original data source ### Dataset List - `class DatasetList:` List of all available datasets. - `List datasets` Array of dataset metadata objects - `String id` Dataset UUID - `LocalDateTime insertedAt` Creation timestamp (UTC) - `String name` Human-readable dataset name - `String slug` URL-friendly identifier - `LocalDateTime updatedAt` Last update timestamp (UTC) - `Optional attribution` Required attribution text - `Optional description` Dataset description - `Optional license` License identifier (e.g. CC-BY-4.0) - `Optional sourceUrl` URL of the original data source