Multi-modal routing for New York City using pgRouting and NYC's LION street network dataset. Supports driving, walking, and biking routes with turn-by-turn directions, isochrone analysis, and traffic-aware routing.
- Multi-modal routing -- Drive, bike, and walk routes with turn-by-turn directions using the Turn-Restricted Shortest Path (pgr_trsp) algorithm
- Isochrone reachability analysis -- Visualize how far you can travel in a given time with polygon fill and per-street edge views
- Multi-stop waypoint routing -- Plan routes with up to 3 stops, with per-leg summaries and an overall route summary
- Traffic-aware routing -- Adjust driving routes using NYC DOT traffic volume data and TRANSCOM real-time speed data
- NYC address autocomplete -- Search NYC addresses with type-ahead suggestions powered by Geosupport
- Responsive design -- Desktop sidebar layout, tablet view, and mobile bottom sheet
- Shareable routes -- Deep link URLs encode origin, destination, mode, and waypoints for sharing
Multi-modal routing |
Isochrone reachability |
Multi-stop waypoints |
Live traffic layer |
NYC address autocomplete |
Edge-based isochrones |
git clone https://github.com/ishiland/nyc-open-routing.git
cd nyc-open-routing
cp .env.example docker/dev/.env
docker compose build
docker compose up -dImport the LION street network (takes 10-30 minutes on first run):
docker compose exec api sh /data-imports/import-lion.sh 25dNavigate to http://localhost:3002 when the import completes. Traffic data is fetched automatically at runtime by the background traffic refresh service.
NYC Open Routing runs three Docker services. The API uses pgRouting's pgr_trsp algorithm against a graph built from NYC DCP's LION street network. The graph encodes per-mode edge costs (drive/bike/walk), one-way restrictions, grade-separated intersections (overpasses and underpasses), and optional traffic factors. See docs/ARCHITECTURE.md for details on data flow, the import pipeline, routing algorithm, and key SQL functions.
| Service | Stack | Ports |
|---|---|---|
| client | React 18 + TypeScript + Vite + MUI + MapLibre GL | 3002 (host) -> 3000 |
| api | Python 3.11 + FastAPI | 5001 (host) -> 5000 |
| db | PostgreSQL 17 + PostGIS + pgRouting | 5433 (host) -> 5432 |
Interactive Swagger docs are available at http://localhost:5001/api/docs when the API is running.
Point-to-point routing between two coordinates.
| Parameter | Type | Required | Description |
|---|---|---|---|
orig |
string | yes | Origin coordinates (longitude,latitude) |
dest |
string | yes | Destination coordinates (longitude,latitude) |
mode |
string | yes | Travel mode: drive, bike, or walk |
use_traffic |
bool | no | Traffic-aware routing for drive mode (default: true) |
avoid_ferries |
bool | no | Avoid ferry crossings for bike/walk (default: false) |
Example request:
curl "http://localhost:5001/api/route?orig=-74.0117,40.6492&dest=-73.9515,40.7971&mode=drive"Example response:
{
"features": [
{
"type": "Feature",
"properties": {
"seq": 1,
"street": "3 AVENUE",
"distance": 260.68,
"travel_time": 0.099,
"turn_instruction": "Continue on 3 AVENUE",
"turn_type": "continue",
"traffic_factor": 1.2
},
"geometry": {
"type": "LineString",
"coordinates": [
[-74.01150, 40.65038],
[-74.01208, 40.64981]
]
}
}
]
}Multi-stop routing through 2-3 waypoints.
| Parameter | Type | Required | Description |
|---|---|---|---|
waypoints |
string | yes | Pipe-delimited coordinates (lon,lat|lon,lat|lon,lat) |
mode |
string | yes | Travel mode: drive, bike, or walk |
use_traffic |
bool | no | Traffic-aware routing for drive mode (default: true) |
avoid_ferries |
bool | no | Avoid ferry crossings for bike/walk (default: false) |
curl "http://localhost:5001/api/route/waypoints?waypoints=-73.98,40.75|-73.99,40.76|-74.00,40.77&mode=drive"Reachability analysis from an origin point.
| Parameter | Type | Required | Description |
|---|---|---|---|
orig |
string | yes | Origin coordinates (longitude,latitude) |
mode |
string | no | Travel mode: drive, bike, or walk (default: drive) |
intervals |
string | no | Comma-separated minutes (default: 5,10,15,20) |
view |
string | no | Visualization: polygon or edges (default: polygon) |
use_traffic |
bool | no | Traffic-aware costs for drive mode (default: true) |
curl "http://localhost:5001/api/isochrone?orig=-73.9857,40.7484&mode=walk&intervals=5,10,15"NYC address autocomplete.
| Parameter | Type | Required | Description |
|---|---|---|---|
address |
string | yes | Partial or full NYC address |
curl "http://localhost:5001/api/search?address=350%20fifth"- LION -- NYC Department of City Planning street network dataset
- Geosupport -- NYC geocoding system, via python-geosupport and geosupport-suggest
- TRANSCOM Speed Data -- Real-time traffic speed data (auto-refreshed by background service)
This project is licensed under the MIT License -- see the LICENSE file for details.
See CONTRIBUTING.md for development setup and guidelines.






