Skip to content

A Foxx based geo example using the new (v3.4+) s2 geospatial index

License

Notifications You must be signed in to change notification settings

arangodb-foxx/demo-geo-s2

Repository files navigation

demo-geo-s2

A Foxx based geo example using the new (v3.4+) s2 geospatial index This example will work with ArangoDB 3.4 and upcoming versions.

Alt text

Preparations

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 })

Usage

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.

About

A Foxx based geo example using the new (v3.4+) s2 geospatial index

Resources

License

Stars

Watchers

Forks

Packages

No packages published