ADR 005: Depth layer from the EMODnet DTM, built and served like the map tiles¶
- Status: Accepted; build, detail and gaps changed by ADR 008
- Date: 2026-10-18
- Deciders: Owner
- Technical Context:
apps/servermaps,infra/depth,infra/tiles; follows ADR 004
Context¶
With our own map tiles (ADR 004) the sea is one flat colour. Sailors read a coast by its depth. Ready-made depth tiles were tested on 2026-10-18: EMODnet's colour tiles are garish and blurry at harbour zoom, its contour layer starts at 50 m. Commercial nautical charts are planned for Pro users later, not for the free website.
Decision¶
- Own depth layer from the EMODnet Bathymetry Digital Terrain Model (latest release, 2024; ≈ 115 m grid; CC BY 4.0, "not for navigation"): depth bands and contour lines at 2, 5, 10, 20, 50, 100, 200, 500 and 1000 m, labels from zoom 12, always on.
- Built by hand per EMODnet release (about every two years) in GitHub Actions: WCS in 2° × 2° pieces → GDAL (one pinned container; GDAL writes PMTiles itself) → one
depth-<date>.pmtiles, zoom 0–12, in the R2 bucket of the map tiles. A yearly check reports a new release. No backup: rebuildable. - Served by the same Worker (
/depth.json,/depth/v/<version>/…), cached like the base map (30 days, version in the URL). - Drawn between the sea and the land of the light theme: the theme's land rules are drawn a second time over the depth, so the OpenStreetMap coastline always wins over the coarser grid.
- A note under the trip map: "Depths are approximate (about 100 m grid) and not for navigation."
- No high-resolution survey areas: precision belongs to the bought charts for Pro users.
Consequences¶
- A few cents a month of extra R2 storage (0.3–1 GB estimated); the build takes about two hours of a runner, every two years.
- The 2 m and 5 m lines are estimates in small bays and near rocks; the note says so.
- The website draws two vector sources in one protomaps-leaflet layer; if the depth source fails, the map shows the flat sea as before.
Addendum 2026-10-18 (after the first live build)¶
Drawing the theme's land a second time over the depth also covered lakes, lagoons and ponds that lie inside land-use or protected-area polygons (seen in the Arcachon basin). Instead, the build now cuts the depth to OpenStreetMap's sea (osmdata.openstreetmap.de water polygons, the coastline the base map uses), and the website draws the depth right after the theme's sea, with no second land pass.
Addendum 2026-10-18 (depth in lakes and rivers)¶
Cutting the depth to OpenStreetMap's sea also removed it from lakes, lagoons and rivers behind the coastline, where the grid often has depths worth showing. Instead the build cuts nothing (only the 2° pieces), and the website masks the depth on the canvas: the theme's water first, the depth drawn only on that water (source-atop), the land behind (destination-over). The depth now follows the base map's water at every zoom, inland water included, and never shows on land. The sea cut was never built, so the live depth file needed no rebuild.