Ruby bindings to Neo4j Spatial
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
examples
lib/neo4j
.gitignore
.project
CHANGELOG
CONTRIBUTORS
Gemfile
LICENSE
README.rdoc
Rakefile
neo4j-spatial.gemspec

README.rdoc

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