Try it out
This blog post uses a dataset of restaurants and neighborhoods in New York City. To run all examples, create two collections called neighborhoods
and code>restaurants and import the dataset with arangoimport
or directly via ArangoDB’s WebUI.
The dataset can be found here:
It contains two JSON files. The neighborhood dataset consists of GeoJSON specified Polygons representing districts in NYC (~200 entries). The restaurant dataset contains restaurants located in NYC which are stored as GeoJSON Points (~20k entries).
Import with arangoimport:
./arangoimport restaurants.json --collection restaurants ./arangoimport neighborhoods.json --collection neighborhoods
After the successful import, create also indices like explained before in chapter GeoJSON Supported Index
. Do not forget to also create the index for the neighborhoods
collection as well:
db.restaurants.ensureIndex({ type: "geo", fields: [ "location" ], geoJson:true }) db.neighborhoods.ensureIndex({ type: "geo", fields: [ "geometry" ], geoJson:true })
Feel free to use the given dataset and queries to play around.
Updated Geo Foxx Service
If you would like to take a look into Foxx and a basic geo example, feel free to download and examine our updated Geo Foxx Service here: