sinabakh / graphium-neo4j

Graphium implementation as a Neo4j plugin with Routing and Map Matching extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Graphium Neo4j

Graphium Neo4j is an extension of the project Graphium based on Neo4j. Neo4j is a famous graph database which comes with various graph algorithms. Neo4j's graph model is built for answering graph dependent questions in a more flexible and performant way than you can do with a relational database. As transport graphs can be modeled as graphs and stored in Neo4j, we benefit from its features.

Graphium Neo4j is built for those who want to manage graphs and graph versions within Neo4j and / or need routing or even a map matching API.

Neo4j Server Plugins

Graphium Neo4j consists of modules which must be deployed as Neo4j Server plugins (so called unmanaged extensions). Therefore Graphium Neo4j is not a standalone server but requires a Neo4j Server.

Deployment

Graphium Neo4j is an extension of Graphium. Therefore Graphium has to be checked out and built before. Then following plugins have to be built and deployed in the Neo4j's plugins directory:

  • graphium-neo4j-server-integration-plugin-XXX.jar (Graphium's core functionality and integration into Neo4j)
  • graphium-api-neo4j-plugin-XXX.jar (API)
  • graphium-routing-neo4j-plugin-XXX.jar (routing functionality and API)
  • graphium-mapmatching-neo4j-plugin-XXX.jar (map matching functionality and API)

Configuration of Graphium

Graphium Neo4j needs some properties files that must be copied in Neo4j's conf directory:

  • graphVersionCapacities.properties
  • import.properties
  • log4j.xml
  • mapmatcher.properties
  • neo4j_db.properties
  • server.properties

The following properties within server.properties have to be adapted. Be careful at changing other property values.

  • graphium.server.name
  • graphium.server.uri

Default property files can be found in neo4j-server-integration/doc/neo4j-default/conf.

Configuration of Neo4j

Graphium Neo4j plugins has to be registered in Neo4j Server. Therefore, neo4j.conf in Neo4j's conf directory has to be extended by:

  • dbms.unmanaged_extension_classes=at.srfg.graphium.neo4j.bootstrap=/graphium
  • dbms.jvm.additional=-Dgraphium.conf.path=file:conf/
  • graphium.secured=true/false

For both routing and map matching a valid graph version (especially validity has to be defined correctly) has to be imported and activated (state is ACTIVE). If a graph version has been imported its state is INITIAL, which normally means someone has to verify the data first or this graph version is only some kind of test version and should not be taken into account for the production system. Only after verification and activation of a graph version it can be used for processing.

Import:

curl -X POST "http://localhost/graphium/api/segments/graphs/{graph}/versions/{version}?overrideIfExists={overrideIfExists}" -F "file=@{FILE}"

Activation:

curl -X PUT "http://localhost/graphium/api/metadata/graphs/{graph}/versions/{version}/state/ACTIVE"

Routing

Graphium Neo4j's routing API handles routing requests between two coordinates on a transport graph. The result will be returned in a JSON format.

API

Examples

A visualized route calculated by Graphium Neo4j's routing engine.


Map: basemap.at

Map Matching

Graphium Neo4j's map matching API matches trajectories onto a transport graph. In contrast to Hidden Markov Model implementations, Graphium Neo4j's map matching core implementation is built for processing trajectories having a high sampling rate (<20 seconds). The main focus was to enable a high-performance processing of those high-sampled trajectories with a very low error ratio. Also low-sampled trajectories can be processed, but with an increasing error ratio. With Graphium's ability of working in distributed systems, you can improve the performance by horizontal scaling. Graphium Neo4j's map matching supports offline and online map matching.

API

Examples

Map Matching of a lower sampled track (for better visualization). Blue point show GPS track points, red linestring represents the map matched path on graph (thin black linestrings).


Map: basemap.at

Map Matching of a track whose GPS track points partially could not have been matched onto graph. The map matcher detects non matchable parts of the track and splits the map matched path.


Map: basemap.at

Plugins Development

You can build your own Neo4j plugins based on Graphium Neo4j. Graphium Neo4j plugins use Spring Framework, which defines configuration information within ApplicationContexts. For integration of custom Neo4j plugins into Graphium Neo4j only one ApplicationContext with the name pattern application-context-graphium-neo4j-plugin*.xml has to be provided. All Beans defined within this ApplicationContext will be loaded automatically by Graphium Neo4j.

Dependencies

About

Graphium implementation as a Neo4j plugin with Routing and Map Matching extensions

License:GNU General Public License v3.0


Languages

Language:Java 100.0%