Giter Club home page Giter Club logo

searoute's Introduction

SeaRoute

Maven Central

SeaRoute computes shortest maritime routes between two locations.

See below an example from Marseille (5.3E,43.3N) to Shanghai (121.8E,31.2N). The red line is the computed maritime route. The black line is the great-circle route.

From Marseille to Shangai

Usage

As a program

SeaRoute requires Java 1.9 or higher. Run java --version to check if Java is installed and what is the current version.

Download the lastest release here and unzip it somewhere.

Examples of executions for windows users are provided in searoute.bat (for linux users, see searoute.sh). test_input.csv is an example of input file. It is a simple CSV file with origin/destination coordinates of the routes. Note that only geographical coordinates (decimal degrees) are supported. The output file is a GeoJSON (*.geojson) file. This file can be displayed with any modern GIS software such as QGIS, or also with geojson.io. Each route has the same properties as the input CSV file, with three additional properties:

  • distKM, which is the length of the route, in KM
  • dFromKM (respectivelly dToKM), which is the distance in KM between the origin (repectivelly destination) position and the closest node of the maritime network. This value measure the approximation arount the origin (respectivelly destination) position. The smaller, the better.

Run java -jar searoute.jar -h to see the help, with a description of all input parameters.

Example

For coders

SeaRoute can be used as a Java library, which can be retrieved using Maven. For that, simply add it as a dependency to the pom.xml file:

<dependency>
	<groupId>eu.europa.ec.eurostat</groupId>
	<artifactId>searoute-core</artifactId>
	<version>X.Y</version>
</dependency>

Where X.Y is the current version number, as available Maven central repository.

For more information on how to setup a coding environment based on Eclipse, see this page.

Here is an example of shortest maritime route computation:

//create the routing object
SeaRouting sr = new SeaRouting();

//get the route between Marseille (5.3E,43.3N) and Shanghai (121.8E,31.2N)
Feature route = sr.getRoute(5.3, 43.3, 121.8, 31.2);

//compute the route distance in km
MultiLineString routeGeom = (MultiLineString) route.getGeometry();
double d = GeoDistanceUtil.getLengthGeoKM(routeGeom);

For further overview, see the documentation.

As a webservice

To deploy SeaRoute as a webservice (Java servlet), run:

git clone https://github.com/eurostat/searoute.git
cd modules/searoute-war
mvn clean package

and move the servlet /target/searoute-XXX.war into your /tomcatX.Y/webapps/ folder. Go then to http://localhost:8080/searoute/ to see the REST-API documentation and some examples.

Some additional information

The shortest maritime routes are computed from a network of lines covering the seas and following some of the most frequent martitime routes. This maritime network is based on the Oak Ridge National Labs CTA Transportation Network Group, Global Shipping Lane Network, World, 2000 (retrieved from geocommons.com or github), enriched with some additional lines around the European coasts based on AIS data. Simplified versions of this network have been produced for different resolutions (5km, 10km, 20km, 50km, 100km) based on a shrinking of too short edges and a removal of similar edges. For more detail on this generalisation algorithm, see the marnet module based on (JGiscoTools)[https://github.com/eurostat/JGiscoTools].

Maritime network overview

SeaRoute can be reused with custom maritime networks produced from some other custom maritime line datasets. The module marnet provides some utilities and examples for the creation and preparation of such maritime network datasets, with generalisation methods. To be able to handle channels, straits and passages such as Suez and Panama channels, the custom maritime sections need to be characterised with a new property pass set with the values suez and panama for the network sections passing by the Suez and Panama channels. The program will then be able to recognise them and possibly avoid them, on user request. The following straits, channels and passages are currently supported:

  • Suez channel
  • Panama channel

since version v3.5:

  • Malacca strait
  • Gibraltar strait
  • Dover strait
  • Bering strait
  • Magellan strait
  • Bab-el-Mandeb strait
  • Kiel channel
  • Corinth channel
  • Northwest passage
  • Northeast passage

The shortest maritime routes are computed from this network using the Dijkstra's algorithm implemented in the wonderful GeoTools library.

Support and contribution

Feel free to ask support, fork the project or simply star it (it's always a pleasure). If anyone feels like helping fixing the existing issues, you are welcome !

searoute's People

Contributors

jgaffuri avatar chillax avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.