Skip to content

ADR 008: Depth with the coastline as 0 m, built on a worker VM

  • Status: Accepted
  • Date: 2026-10-20
  • Deciders: Owner
  • Technical Context: infra/depth, infra/worker, infra/oci, apps/server maps; changes ADR 005

Context

The first depth layer (ADR 005) contoured EMODnet's 115 m grid, simplified the lines by 25 m and stopped at zoom 12. At harbour zoom the owner found it "unusable for a sailor" (2026-10-19, Golfo delle Saline): lines in straight runs of 200–900 m, and a white strip between the shallowest band and the coast wherever the grid's cells mix sea and beach. A prototype on three bays (Sardinia, Croatia, Greece) showed that the same EMODnet data gives smooth, believable depths when OpenStreetMap's coastline is taken as the 0 m line and the gap is filled on a fine grid. Nothing finer and open exists for Italy, Croatia or Greece; national open grids (Shom Litto3D, Kartverket, …) exist for some other coasts.

Decision

  • Coastline as 0 m: the depth is built on an ≈ 11 m grid near the coast from EMODnet's DTM, its high-resolution patches and OpenStreetMap's water polygons; EMODnet cells that mix sea and land are rebuilt from the coastline. Tiles to zoom 15, smoothed lines.
  • Honest gaps: sea far (> 250 m) from any measured depth is shown as "no depth data" (dark navy with a hatch), never as an invented depth and never white or land-coloured. Drying flats get their own colour, only in tidal seas. Inland water (not inside the coastline) gets no depth.
  • ODbL: the depth is shaped by OpenStreetMap's coastline, so the depth tiles are offered under the ODbL; EMODnet's CC BY attribution stays.
  • A worker VM for heavy jobs: a third Always Free VM (sailever-worker, 2 OCPU / 12 GB, private subnet, no inbound port, its own SSH tunnel) runs heavy jobs as a separate Kamal service with cron (supercronic). The depth build runs there straight through until it is published (about a day), carries on by itself after a reboot or a deploy, and starts again about monthly. It replaces the hand-run GitHub workflow depth.yml.
  • National open grids are a later step; the pipeline takes more sources the same way as EMODnet's patches.

Consequences

  • Block storage reaches the Always Free limit (3 × 50 GB boot + 50 GB data); a second free app server no longer fits.
  • A build takes about a day; it runs once a month. No GitHub Actions minutes.
  • The depth file grows to about 2–3 GB (cents a month on R2).
  • The website draws two kinds of builds until the first worker build is live (depth.json "schema": 2).
  • Near the shore the depth is an estimate between the coastline and EMODnet's nearest measured cell; the note under the trip map says so.
  • Harbour basins and narrow inlets without EMODnet data show as "no depth data" until better sources are added.