Skip to content

Jupyter Notebooks

Interactive tutorials and examples for the Nautical Graph Toolkit. Each notebook demonstrates real-world workflows with actual S-57 ENC data.

📚 Available Notebooks

S-57 Data Import & Conversion

Transform raw S-57 ENC data into geospatial databases.

Maritime Graph Creation

Build routing networks with different backends and resolutions.

PostGIS Workflows

GeoPackage Workflows

SpatiaLite Workflows

Utilities & Analysis

Helper functions and data inspection tools.

Advanced Analysis

Performance benchmarking and algorithm comparison.

🚀 How to Use

Option 1: View Online

Each notebook link above will open in Jupyter nbviewer (read-only).

Option 2: Run Locally

Prerequisites

Install the toolkit following the Installation Guide, then verify Jupyter is available:

python -c "from jupyter import __version__; print(f'Jupyter {__version__} installed')"

Start Jupyter

# From project root
jupyter notebook

# Or use Jupyter Lab (recommended)
jupyter lab

Then navigate to docs/notebooks/ and select a notebook.

Option 3: Google Colab (Cloud)

Several notebooks are Colab-compatible for cloud execution without local setup.

📊 Notebook Categories

Beginner

Start here if you're new to the toolkit.

Intermediate

Deep dives into specific features.

Advanced

Production workflows and optimization.

💾 Backend Comparison

These notebooks demonstrate the same workflows across different backends. See the Setup Guide — Backend Comparison for a full feature table.

Recommendation: Start with GeoPackage for simplicity, scale to PostGIS for production.

⚙️ Prerequisites

All notebooks require:

  • Python 3.11+
  • GDAL 3.10.3 (installed via Conda)
  • Nautical Graph Toolkit installed in editable mode
  • Sample S-57 ENC data (included in tests/data/ENC_ROOT/)

📝 Tips for Running Notebooks

  1. Cell-by-cell execution: Run cells individually to explore intermediate results
  2. Check memory: Large ENC datasets may need >4GB RAM
  3. Enable outputs: Use jupyter notebook --NotebookApp.trust_xsrfless_cookies=False
  4. Export results: Save GeoJSON outputs and open in QGIS for visualization

🐛 Troubleshooting

Issue: GDAL not found

# Verify GDAL is installed in conda environment
python -c "from osgeo import gdal; print(gdal.__version__)"

Issue: Database connection errors

# Check PostGIS is running (if using PostGIS)
docker-compose ps

# Or verify GeoPackage file exists
ls -la maritime.gpkg

Issue: Notebook doesn't start

# Ensure Jupyter is installed in the activated environment
mamba activate nautical
pip install jupyter jupyterlab

💡 Want to Contribute?

Notebooks are a great way to contribute! If you have interesting examples or improvements:

  1. Create your notebook in docs/notebooks/
  2. Test thoroughly with multiple backends
  3. Add it to this index
  4. Submit via GitHub

See Contributing Guide for details.


Happy exploring! 🚢⚓