jgrapht-routing-core

Routing Library

License

License

Categories

Categories

JGraphT General Purpose Libraries
GroupId

GroupId

com.github.mapkiwiz.routing
ArtifactId

ArtifactId

jgrapht-routing-core
Last Version

Last Version

0.4
Release Date

Release Date

Type

Type

jar
Description

Description

jgrapht-routing-core
Routing Library

Download jgrapht-routing-core

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.mapkiwiz.routing/jgrapht-routing-core/ -->
<dependency>
    <groupId>com.github.mapkiwiz.routing</groupId>
    <artifactId>jgrapht-routing-core</artifactId>
    <version>0.4</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.mapkiwiz.routing/jgrapht-routing-core/
implementation 'com.github.mapkiwiz.routing:jgrapht-routing-core:0.4'
// https://jarcasting.com/artifacts/com.github.mapkiwiz.routing/jgrapht-routing-core/
implementation ("com.github.mapkiwiz.routing:jgrapht-routing-core:0.4")
'com.github.mapkiwiz.routing:jgrapht-routing-core:jar:0.4'
<dependency org="com.github.mapkiwiz.routing" name="jgrapht-routing-core" rev="0.4">
  <artifact name="jgrapht-routing-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.mapkiwiz.routing', module='jgrapht-routing-core', version='0.4')
)
libraryDependencies += "com.github.mapkiwiz.routing" % "jgrapht-routing-core" % "0.4"
[com.github.mapkiwiz.routing/jgrapht-routing-core "0.4"]

Dependencies

compile (6)

Group / Artifact Type Version
org.springframework : spring-jdbc jar 4.2.0.RELEASE
com.google.code.gson : gson jar 2.2.4
org.jgrapht : jgrapht-core jar 0.9.1
org.apache.commons : commons-csv jar 1.1
org.slf4j : slf4j-api jar 1.7.2
org.slf4j : slf4j-simple jar 1.7.2

test (3)

Group / Artifact Type Version
org.postgresql : postgresql jar 9.3-1103-jdbc4
org.hsqldb : hsqldb jar 2.3.3
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Java Routing Machine

Build status Maven Central

Build and run

Using Maven 2/3 :

mvn clean install tomcat7:run

This will start a Tomcat container at http://localhost:8080/routing with some test data.

The test data cover the Rhône-Alpes region in France. Test data are in geographic coordinates (WGS84, epsg:4326) with time(cost) = distance (meters).

Example queries

Using HTTPie client :

Locate nearest network node around Lyon (4.834413,45.767304) :

http GET :8080/routing/api/v1/distance lon==4.834413 lat==45.767304

Returns a GeoJSON Point :

{
    "geometry": {
        "coordinates": [
            4.834413, 
            45.767304
        ], 
        "type": "Point"
    }, 
    "properties": {
        "id": 24951, 
        "request_lat": 45.767304, 
        "request_lon": 4.834413
    }, 
    "type": "Feature"
}

Distance from Lyon (4.834413,45.767304) to Valence (4.890021,44.930435) :

http GET :8080/routing/api/v1/distance source==4.834413,45.767304 target==4.890021,44.930435

Returns :

{
    "distance": 100497.0, 
    "distance_unit": "meters", 
    "source": {
        "coordinates": [
            4.834413, 
            45.767304
        ], 
        "type": "Point"
    }, 
    "target": {
        "coordinates": [
            4.890021, 
            44.930435
        ], 
        "type": "Point"
    }, 
    "time": 100497.0, 
    "time_unit": "minutes"
}

Route from Lyon to Valence :

http GET :8080/routing/api/v1/route source==4.834413,45.767304 target==4.890021,44.930435

Returns GeoJSON LineString.

30 km isochrone around Valence :

http GET :8080/routing/api/v1/isochrone lon==4.890021 lat==44.930435 \
distance==30000 concave==true

Returns GeoJSON Polygon.

Using as a library

Add the following dependency to your project pom.xml :

<dependency>
  <groupId>com.github.mapkiwiz</groupId>
  <artifactId>jgrapht-routing-core</artifactId>
  <version>0.4</version>
</dependency>

Feeding in your own data

TODO

Getting data from OpenStreetMap

TODO

Versions

Version
0.4