A Foxx based geo example using the new (v3.4+) s2 geospatial index This example will work with ArangoDB 3.4 and upcoming versions.
First install the foxx service. Create two document collections called restaurants
and neighborhoods
.
Then import the needed datasets from data
folder.
./arangoimp restaurants.json --collection restaurants
./arangoimp neighborhoods.json --collection neighborhoods
Afterwards make sure to create the two geo indices:
db.restaurants.ensureIndex({ type: "geo", fields: [ "location" ], geoJson:true })
db.neighborhoods.ensureIndex({ type: "geo", fields: [ "geometry" ], geoJson:true })
Buttons:
- Random restaurant: Draw and point to a random restaurant
- Random neighborhood: Draw and point to a random neighborhood
Click on a drawn neighborhood to also draw all included restaurants.