0.01
No commit activity in last 3 years
No release in over 3 years
Neo4j-Spatial adds GIS and spatial analysis capabilities to the Neo4j Graph Database. This allows you to load spatial data, like points, lines, polygons and more complex geometries, index them and perform fast spatial queries on them. It includes specific support for OSM data, and Simple Feature data (as found in Shapefile format), but can be layered on top of any existing Neo4j database with spatial data, or data with some spatial elements. The Neo4j-Spatial.rb wrapper allows you to access Neo4j-Spatial features from the convenience of the Ruby scripting language.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.0.1
>= 1.0.0
 Project Readme

Welcome to neo4j-spatial.rb¶ ↑

Neo4j is a graph database for Java, Neo4j.rb is a graph database for JRuby using Neo4j internally. Neo4j-spatial.rb is a wrapper on Neo4j.rb that includes all the Java dependencies to enable spatial analysis, and includes some Ruby wrappers to access the spatial utilities.

For more information on the underlying components refer to:

  • Neo4J - for persistence and traversal of the graph

  • Neo4J.rb - for Ruby API to Neo4j

  • Neo4j-Spatial - for loading, indexing and analysing spatial data

Why Neo4j-Spatial.rb ?¶ ↑

When we wrote Neo4j-spatial we found that while it had many capabilities, most users did not know about them. The lack of articles, blogs and examples made the code a little unapproachable. This Ruby wrapper was originally written to support writing blogs about some of the interesting use cases that are possible with Neo4j-Spatial, but the decision to base it on Andreas Ronges excellent Neo4j.rb library also means that it can be used in a much wider context, including Rails application.

Documentation¶ ↑

.. to be done ..

Installation¶ ↑

Two options:

  • As a RubyGem: jruby -S gem install neo4j-spatial

  • From source: git clone git@github.com:craigtaverner/neo4j-spatial.rb.git

Take note that neo4j-spatial.rb requires that you install the neo4j gem for database access, and optionally the amanzi-sld gem (for advanced styling of the PNG exports). If you install neo4j-spatial as a rubygem, you should get these dependencies automatically, otherwise be sure to install them before running the examples below.

Some Examples¶ ↑

.. to be done .. (or see the code in the command-line utilities described below for examples)

Command-line utilities¶ ↑

The examples directory includes a few sample Ruby scripts for various import/export tasks, as well as some sample OSM data to test one. Consider the following run through:

git clone git@github.com:craigtaverner/neo4j-spatial.rb.git
cd neo4j-spatial.rb/examples
jruby osm_import.rb map2.osm
jruby osm_layer.rb map2.osm highway highway-residential waterway natural natural-water
jruby osm_layer.rb -l
jruby export_layer.rb highway-residential
jruby export_layer.rb -F shp highway-residential natural

Then take a look in the examples/target/export directory for the PNG and SHP files generated. Run each of the three utility commands with no arguments, or with -h, to see what options are available.

Contributing¶ ↑

Have you found a bug, need help or have a patch ? Just clone neo4j-spatial.rb and send me a pull request or email me. Do you need help - mail the neo4j or neo4j.rb mailing lists.

License¶ ↑