Execute a PlazaQL query
query.execute(**kwargs) -> FeatureCollection { features, type }
POST/api/v1/query
Execute a PlazaQL query
Execute a PlazaQL query
require "plaza"
plaza = Plaza::Client.new(
api_key: "My API Key",
environment: "local" # defaults to "production"
)
feature_collection = plaza.query.execute(
data: "$$ = search(node, amenity: \"cafe\").around(distance: 500, geometry: point(48.8566, 2.3522));"
)
puts(feature_collection){
"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"
}