searoute
A python package for generating the shortest sea route between two points on Earth.
What it is and what it does
Searoute computes realistic shortest paths across ocean waters between two points on Earth, accounting for land masses by finding the nearest sea point if either endpoint is on land. It returns a GeoJSON LineString Feature with calculated distance and optional port information, designed for visualizing maritime routes rather than for actual ship navigation.
The package uses a graph-based approach with networkx as the default backend (or igraph optionally for performance), and supports customization through user-supplied node and edge networks, passage restrictions (e.g., avoiding the Suez Canal), and preferred port selection via area-based weighting. Distance can be computed in multiple units (kilometers, miles, nautical miles, etc.) and duration estimates are available based on vessel speed.
Use it for:
- Generate realistic sea routes for maritime trade flow visualizations and shipping analytics dashboards
- Calculate approximate voyage durations and distances for supply chain planning and logistics simulation
- Build interactive maps showing port-to-port connectivity with customizable passage restrictions
- Analyze maritime chokepoints by computing routes that avoid specific straits or canals
- Create educational visualizations of global shipping patterns and international trade corridors
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes the shortest sea route between two geographic points, returning a GeoJSON LineString with distance and optional port information for maritime visualization.
Yes, if you need to visualize or analyze maritime routes. The package is actively maintained, has no known vulnerabilities, and is licensed permissively. High install friction (two non-trivial dependencies) is manageable for projects where route visualization is a core feature. Not suitable for real-time navigation or precise maritime routing.
Install
searoute on PyPI
pip
pip install searouteuv
uv add searoutepoetry
poetry add searouteInstalling searoute
Before you install
High install friction due to dependencies on geojson and networkx, though both are stable. Active maintenance with recent releases; last commit 2026-05-17 and 152 repository stars indicate ongoing development.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install searoute
import searoute as sr
origin = [0.3515625, 50.064191736659104]
destination = [117.42187500000001, 39.36827914916014]
route = sr.searoute(origin, destination)
print("{:.1f} {}".format(route.properties['length'], route.properties['units']))
Verify before relying
- Whether the package handles edge cases (e.g., antipodal points, routes crossing date line) reliably
- Performance characteristics and scalability limits for repeated route calculations
- Accuracy of the underlying maritime graph and how frequently it is updated
Package facts
| License | Apache-2.0 (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | 2 — geojson, networkx |
| Maintenance | actively maintained — 89 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 85,460/month — #13,921 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: searoute-1.6.0.tar.gz
Keywords: searoute, map, sea, route, ocean, ports
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
haversineCalculates great-circle distances between…
permissive · top 5,000 on PyPI
global-land-maskDetermines whether geographic coordinates…
permissive · top 15,000 on PyPI
DijkstarDijkstar implements Dijkstra's shortest-path…
permissive · top 15,000 on PyPI
polylineEncodes and decodes geographic coordinate…
unclear · top 5,000 on PyPI
geopygeopy is a Python client for geocoding and…
permissive · top 5,000 on PyPI
pyGeoTileConverts between geographic coordinate systems…
permissive · top 15,000 on PyPI
grandalfGrandalf computes node coordinates and routes…
copyleft · top 5,000 on PyPI
geojsonEncodes, decodes, and represents GeoJSON…
permissive · top 5,000 on PyPI
pymap3dConverts between geographic and 3-D coordinate…
permissive · top 15,000 on PyPI
mgrsConverts between MGRS (Military Grid Reference…
permissive · top 15,000 on PyPI