Skip to content

docs: tutorial notebook for OGC API – Moving Features endpoints#9

Open
estebanzimanyi wants to merge 1 commit into
MobilityDB:masterfrom
estebanzimanyi:docs/tutorial-notebook
Open

docs: tutorial notebook for OGC API – Moving Features endpoints#9
estebanzimanyi wants to merge 1 commit into
MobilityDB:masterfrom
estebanzimanyi:docs/tutorial-notebook

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

Summary

Adds tutorial.ipynb at the repo root — a guided notebook walking through MobilityAPI's OGC API – Moving Features endpoints against the Danish Maritime Authority AIS dataset that is already used by demo.ipynb and across the wider MEOS ecosystem (PyMEOS-Examples, JMEOS-Examples).

Mirrors the slide-deck narrative without re-implementing the substrate: endpoint shapes, JSON payloads, and the data/trajectories_mf1.json source match the existing demo.ipynb so the same backend session serves both notebooks.

Sections

Step Endpoint What it shows
0 DELETE /collections/{id} reset state (idempotent re-runs)
1 POST /collections create the ships collection
2 GET /collections list collections
3 POST /collections/{id}/items stream-batch AIS vessels as FeatureCollection of MovingPoint features
4 GET /collections/{id}/items?limit=… list + folium map of all trajectories (brown)
5 GET /collections/{id}/items?bbox=… spatial filter on Rødby harbour envelope
6 GET /…/items/{mFeatureId}/tgsequence per-vessel temporal-geometry sequence
7 GET /…/tgsequence/{tGeometryId}/velocity derived TReal measure + matplotlib plot
8 GET /…/items?subTrajectory=true&datetime=… temporal slice with green overlay over the full set

Files

  • tutorial.ipynb — 32 cells (16 markdown / 16 code), nbformat 4.5
  • README.md — one-line pointer to the notebook under Usage

Validation

  • python3 -m nbformat ... validate → OK, all 32 cells have IDs
  • ast.parse on every code cell → no syntax errors
  • Endpoint shapes + JSON payloads identical to those in demo.ipynb (which runs against a live server today)

Test plan

  • Start the server: ./run.sh
  • Open tutorial.ipynb in Jupyter / VS Code
  • Run all cells top-to-bottom — Step 0 cleans state, Step 3 ingests the AIS file, the folium maps in Steps 4/5/8 render
  • Optional: verify the velocity plot in Step 7 renders for the first bbox-matching vessel

…outputs

tutorial.ipynb walks through the eight core MobilityAPI endpoints
(DELETE/POST collection, POST/GET items, bbox spatial filter, tgsequence,
velocity, subTrajectory) end-to-end against the Danish Maritime
Authority AIS dataset, with matplotlib + contextily visualisations:

- All-vessels overview map (brown trajectories on CartoDB Positron)
- BBox-filtered map with Rødby harbour envelope on OpenStreetMap
- Multi-vessel velocity profile comparison with a 10-knot speed-limit
  reference line and shaded violation zone
- Subtrajectory result summary table (DataFrame)
- Green-over-brown subtrajectory overlay against full trajectories

Outputs committed inline (14/17 code cells have rendered outputs:
image/png, text/html, stream) so the notebook renders fully on GitHub
without a server. Two conceptual figures bundled under doc/images:

- ogc-moving-features-class-diagram.png — OGC standard figure 1
- mobilityapi-backing-schema.png — the PostgreSQL schema MobilityAPI
  creates on first POST (collections, moving_features,
  temporal_geometries, temporal_properties, temporal_values)

README gains a one-line pointer to tutorial.ipynb under Usage.
@estebanzimanyi estebanzimanyi force-pushed the docs/tutorial-notebook branch from ccbb5c4 to 7d0bd03 Compare May 21, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant