Fetch multiple features by type and ID
elements.batch(ElementBatchParams**kwargs) -> FeatureCollection
POST/api/v1/features/batch
Fetch multiple features by type and ID
import os
from plaza import Plaza
client = Plaza(
api_key=os.environ.get("PLAZA_API_KEY"), # This is the default and can be omitted
)
feature_collection = client.elements.batch(
elements=[{
"id": 21154906,
"type": "node",
}, {
"id": 4589123,
"type": "way",
}],
)
print(feature_collection.features){
"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"
}Returns Examples
{
"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"
}