Searoute.NET
1.0.1
Please use the package SeaRoute.Core for better result and optimized solution .
Thanks all.
See the version list below for details.
dotnet add package Searoute.NET --version 1.0.1
NuGet\Install-Package Searoute.NET -Version 1.0.1
<PackageReference Include="Searoute.NET" Version="1.0.1" />
<PackageVersion Include="Searoute.NET" Version="1.0.1" />
<PackageReference Include="Searoute.NET" />
paket add Searoute.NET --version 1.0.1
#r "nuget: Searoute.NET, 1.0.1"
#:package Searoute.NET@1.0.1
#addin nuget:?package=Searoute.NET&version=1.0.1
#tool nuget:?package=Searoute.NET&version=1.0.1
Searoute.NET
A .NET package for generating the shortest sea route between two points on Earth.
If points are on land, the function will attempt to find the nearest point on the sea and calculate the route from there.
Not for routing purposes! This library was developed to generate realistic-looking sea routes for visualizations of maritime routes, not for mariners to route their ships.
Installation
dotnet add package Searoute.NET
Or via NuGet Package Manager:
Install-Package Searoute.NET
Usage
using Searoute.NET;
using Searoute.NET.Models;
// Define origin and destination GeoJSON points
var origin = new GeoJsonFeature
{
Type = "Feature",
Properties = new Dictionary<string, object>(),
Geometry = new GeoJsonPoint
{
Type = "Point",
Coordinates = new[] { 132.5390625, 21.616579336740603 }
}
};
var destination = new GeoJsonFeature
{
Type = "Feature",
Properties = new Dictionary<string, object>(),
Geometry = new GeoJsonPoint
{
Type = "Point",
Coordinates = new[] { -71.3671875, 75.05035357407698 }
}
};
// Calculate route
var service = SearouteService.Instance;
var route = service.CalculateRoute(origin, destination);
// Returns a GeoJSON LineString Feature
// Optionally, define the units for the length calculation
// Defaults to nautical miles ("nm"), can be "degrees", "miles", "kilometers"/"km"
var routeMiles = service.CalculateRoute(origin, destination, "miles");
// Access route properties
Console.WriteLine($"Route length: {route.Properties["length"]} {route.Properties["units"]}");
Features
- Calculate shortest maritime routes between any two points on Earth
- Automatic snapping to maritime network for land-based coordinates
- Support for multiple distance units (nautical miles, miles, kilometers, degrees)
- GeoJSON-compatible input and output
- Based on proven Dijkstra pathfinding algorithm
License
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0).
Credits
- Based on Eurostat's Searoute Java library (EUPL-1.2 licensed)
- Maritime network data derived from Eurostat's marnet dataset
- Original JavaScript implementation: searoute-js
Requirements
- .NET 9.0 or higher
- NetTopologySuite for geospatial operations
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- NetTopologySuite (>= 2.5.0)
- NetTopologySuite.IO.GeoJSON (>= 4.0.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.