# Elements ## Query features by spatial predicate, bounding box, or H3 cell `$ plaza elements query` **get** `/api/v1/features` Query features by spatial predicate, bounding box, or H3 cell ### Parameters - `--bbox: optional string` Legacy shorthand. Bounding box: south,west,north,east. Use spatial predicates (near, within, intersects) instead. - `--contains: optional string` Geometry that features must contain - `--crosses: optional string` Geometry that features must cross - `--cursor: optional string` Cursor for pagination - `--h3: optional string` Legacy shorthand. H3 cell index. Use spatial predicates instead. - `--intersects: optional string` Geometry that features must intersect - `--limit: optional number` Maximum results (default 100, max 10000) - `--near: optional string` Point geometry for proximity search (lat,lng). Requires radius. - `--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 - `--radius: optional number` Search radius in meters (for near) or buffer distance (for other predicates) - `--touches: optional string` Geometry that features must touch - `--type: optional string` Element types (comma-separated: node,way,relation) - `--within: optional string` Geometry that features must be within ### 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 elements query \ --api-key 'My API Key' ``` #### 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" } ``` ## Query features by spatial predicate, bounding box, or H3 cell `$ plaza elements query-post` **post** `/api/v1/features` Query features by spatial predicate, bounding box, or H3 cell ### Parameters - `--bbox: optional string` Legacy shorthand. Bounding box: south,west,north,east. Use spatial predicates (near, within, intersects) instead. - `--contains: optional string` Geometry that features must contain - `--crosses: optional string` Geometry that features must cross - `--cursor: optional string` Cursor for pagination - `--h3: optional string` Legacy shorthand. H3 cell index. Use spatial predicates instead. - `--intersects: optional string` Geometry that features must intersect - `--limit: optional number` Maximum results (default 100, max 10000) - `--near: optional string` Point geometry for proximity search (lat,lng). Requires radius. - `--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 - `--radius: optional number` Search radius in meters (for near) or buffer distance (for other predicates) - `--touches: optional string` Geometry that features must touch - `--type: optional string` Element types (comma-separated: node,way,relation) - `--within: optional string` Geometry that features must be within ### 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 elements query-post \ --api-key 'My API Key' ``` #### 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" } ``` ## Get feature by type and ID `$ plaza elements retrieve` **get** `/api/v1/features/{type}/{id}` Get feature by type and ID ### Parameters - `--type: string` Element type (node, way, relation) - `--id: number` OSM ID ### Returns - `geo_json_feature: object { geometry, properties, type, id }` GeoJSON Feature representing an OSM element. Tags from the original OSM element are flattened directly into `properties` (not nested under a `tags` key). Metadata fields `@type` and `@id` identify the OSM element type and ID within properties. - `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 ### Example ```cli plaza elements retrieve \ --api-key 'My API Key' \ --type type \ --id 0 ``` #### Response ```json { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "@id": "bar", "@type": "bar", "amenity": "bar", "cuisine": "bar", "name": "bar" }, "type": "Feature", "id": "node/21154906" } ``` ## Get feature by type and ID `$ plaza elements lookup` **post** `/api/v1/features/lookup` Get feature by type and ID ### Returns - `geo_json_feature: object { geometry, properties, type, id }` GeoJSON Feature representing an OSM element. Tags from the original OSM element are flattened directly into `properties` (not nested under a `tags` key). Metadata fields `@type` and `@id` identify the OSM element type and ID within properties. - `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 ### Example ```cli plaza elements lookup \ --api-key 'My API Key' ``` #### Response ```json { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "@id": "bar", "@type": "bar", "amenity": "bar", "cuisine": "bar", "name": "bar" }, "type": "Feature", "id": "node/21154906" } ``` ## Fetch multiple features by type and ID `$ plaza elements batch` **post** `/api/v1/features/batch` Fetch multiple features by type and ID ### Parameters - `--element: array of object { id, type }` Array of element references to fetch ### 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 elements batch \ --api-key 'My API Key' \ --element '{id: 21154906, type: node}' \ --element '{id: 4589123, type: way}' ``` #### 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" } ``` ## Find features near a geographic point `$ plaza elements nearby` **get** `/api/v1/features/nearby` Find features near a geographic point ### Parameters - `--lat: optional number` Legacy shorthand. Latitude (-90 to 90). Use near param instead. - `--limit: optional number` Maximum results (default 20, max 100) - `--lng: optional number` Legacy shorthand. Longitude (-180 to 180). Use near param instead. - `--near: optional string` Point geometry for proximity search (lat,lng or GeoJSON). Alternative to lat/lng params. - `--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 - `--radius: optional number` Search radius in meters (default 500, max 10000) ### 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 elements nearby \ --api-key 'My API Key' ``` #### 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" } ``` ## Find features near a geographic point `$ plaza elements nearby-post` **post** `/api/v1/features/nearby` Find features near a geographic point ### Parameters - `--lat: optional number` Legacy shorthand. Latitude (-90 to 90). Use near param instead. - `--limit: optional number` Maximum results (default 20, max 100) - `--lng: optional number` Legacy shorthand. Longitude (-180 to 180). Use near param instead. - `--near: optional string` Point geometry for proximity search (lat,lng or GeoJSON). Alternative to lat/lng params. - `--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 - `--radius: optional number` Search radius in meters (default 500, max 10000) ### 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 elements nearby-post \ --api-key 'My API Key' ``` #### 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 ### Batch Request - `batch_request: object { elements }` Fetch multiple OSM elements by their type and ID in a single request. Maximum 100 elements per batch. - `elements: array of object { id, type }` Array of element references to fetch - `id: number` OSM element ID - `type: "node" or "way" or "relation"` OSM element type - `"node"` - `"way"` - `"relation"`