Skip to content
jroetmanPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 

Repository files navigation

# Maritime Shortest Path Calculator An interactive web application that calculates the shortest maritime routes between any two points on the globe using advanced graph algorithms. ## Features - πŸ—ΊοΈ **Interactive Map**: Click on any two points to calculate the shortest maritime route - 🚒 **Multiple Routing Graphs**: Choose between MarNet and Oak Ridge maritime networks - 🌐 **Globe Wrapping**: Properly handles routes that cross the international date line - πŸ“Š **Route Statistics**: View distance, waypoints, and routing information - πŸ“± **Responsive Design**: Works on desktop and mobile devices - ⚑ **Real-time Calculation**: Fast API-based route computation ## Installation 1. Clone this repository: ```bash git clone cd shortestpath ``` 2. Install the required dependencies: ```bash pip install -r requirements.txt ``` ## Usage 1. Start the Flask development server: ```bash python app.py ``` 2. Open your web browser and navigate to: ``` http://localhost:5000 ``` 3. Use the application: - Click on the map to select your origin point (green marker A) - Click again to select your destination point (red marker B) - The shortest route will be calculated automatically - View route statistics in the information panel below the map - Use the "Clear Map" button to start over - Switch between different routing graphs using the dropdown ## API Endpoints ### POST /api/shortest-path Calculate the shortest path between two points. **Request Body:** ```json { "origin": { "lat": 31.23, "lng": 121.47 }, "destination": { "lat": 32.08, "lng": -81.09 }, "graph_type": "marnet" } ``` **Response:** ```json { "success": true, "data": { "length": 12500.5, "coordinate_path": [[lat, lng], ...], "clean_paths": [[[lat, lng], ...], ...] } } ``` ### GET /api/graph-info Get information about available routing graphs. ## Graph Types - **MarNet**: Maritime routing network optimized for general maritime navigation - **Oak Ridge**: Oak Ridge maritime routing network with specialized routing algorithms ## Technical Details - **Backend**: Flask (Python) - **Frontend**: HTML5, CSS3, JavaScript, Leaflet.js - **Routing Engine**: SCGraph library - **Map Visualization**: Leaflet with OpenStreetMap tiles ## Dependencies - `scgraph>=2.12.0`: Core routing algorithms and maritime graphs - `folium==0.16.0`: Map visualization (for the original script) - `flask>=2.0.0`: Web framework - `flask-cors>=4.0.0`: Cross-origin resource sharing ## Original Script The original `getting_started.py` file contains examples of how to use the SCGraph library directly without the web interface. You can still run it for command-line usage: ```bash python getting_started.py ``` ## Contributing Feel free to submit issues and enhancement requests! ## License This project is open source and available under the MIT License. # routing

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors