Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.01 KB

README.md

File metadata and controls

30 lines (21 loc) · 1.01 KB

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.