Skip to content
master
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
doc
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SeaRoute

SeaRoute computes shortest maritime routes between pairs of 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

NEW: It is now possible to compute maritime routes avoiding the Suez and/or Panama channel.

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), SHP (*.shp) or GeoPackage (*.gpkg) file. This file can be displayed on any modern GIS software such as QGIS. GeoJSON files can be displayed easily with geojson.io.

Run java -jar searoute.jar -h to see the help which describes everything you need to know.

Example

For coders

SeaRoute can be used as a Java library. To quickly setup a development environment, see these instructions.

Download and install SeaRoute with:

git clone https://github.com/eurostat/searoute.git
cd searoute
mvn clean install

and then use it in your Java project as a dependency by adding it to the pom.xml file:

<dependencies>
	...
	<dependency>
		<groupId>eu.europa.ec.eurostat</groupId>
		<artifactId>searoute-core</artifactId>
		<version>2.1</version>
	</dependency>
</dependencies>

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);

//extract the route in geoJSON format
String rgj = SeaRoute.toGeoJSON(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.

Maritime network overview

SeaRoute can be reused with custom maritime networks produced from some other custom maritime line datasets. The class MarnetBuilding provides some utilities for the creation and preparation of such maritime network datasets, with generalisation methods. To be able to handle Suez and Panama channels, the custom maritime sections need to be characterised with a new property desc_ 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 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 !

You can’t perform that action at this time.