Database - Plateful/plateful-mobile GitHub Wiki

Download Spatial Plugin for Neo4j on Server

  1. Get into directory

    cd /var/lib/neo4j/plugins
    
  2. Download file in directory

    sudo wget "https://raw.githubusercontent.com/neo4j-contrib/m2/master/releases/org/neo4j/neo4j-spatial/0.13-neo4j-2.1.2/neo4j-spatial-0.13-neo4j-2.1.2-server-plugin.zip"
    
  3. Unzip plugins in directory

    sudo unzip neo4j-spatial-0.13-neo4j-2.1.2-server-plugin.zip
    

Setup Spatial R-Tree

  1. Create a simple point layer

curl -X POST -d '{"layer":"geom","lat":"lat","lon":"lon"}' --header "Content-Type:application/json" http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer ```

  1. Add a spatial index

curl -X POST -d '{"name":"geom","config" {"provider":"spatial","geometry_type":"point","lat":"lat","lon":"lon"}}' --header "Content-type:application/json" http://localhost:7474/db/data/index/node/ ```

Restarting Database

  1. Log into [email protected]
  2. cd /var/lib/neo4j/bin
  3. Check if neo4j is running: sudo ./neo4j status
  4. If neo4j is not running: sudo ./neo4j start
  5. If there is another process: pkill [process #]
  6. If needed: sudo ./neo4j start