From 3bc05f4f776389749fbe6d5327ca493ffe9efb66 Mon Sep 17 00:00:00 2001 From: Jeremy Collins Date: Sun, 12 Jul 2026 22:19:33 -0400 Subject: [PATCH] docs: lead with native S-101 chart support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tile57 reads native S-101 (S-100 Part 10a) ENC charts directly — auto-detected from the .000 file — in addition to legacy S-57 cells. The README still framed the engine as S-57-only; reframe the banner, intro, and pipeline to lead with the dual-format capability (native S-101 read straight into the model + its .001.. updates; S-57 adapted), and note that every CLI/API entry auto-detects the format. getting-started gains the same note plus the 'tile57 s101' inspector. The intro/architecture/cli/limitations pages already carry the detail. --- README.md | 65 ++++++++++++++++++++++-------------- docs/docs/getting-started.md | 5 ++- 2 files changed, 44 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 742cce5..97a91ca 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@

tile57

- ⚓ An S-57/S-101 chart engine: vector tiles, S-52 styles, PNG and PDF.
- tile57 turns IHO S-57 ENC cells into vector tiles (MLT or MVT) with a matching MapLibre - S-52 style, or renders finished charts directly to PNG and PDF — one Zig library with a - C ABI, compiled natively or to WASM. + ⚓ An S-101 / S-57 chart engine: vector tiles, S-52 styles, PNG and PDF.
+ tile57 reads native IHO S-101 ENC charts — and legacy S-57 cells — and turns + them into vector tiles (MLT or MVT) with a matching MapLibre S-52 style, or renders finished + charts directly to PNG and PDF — one Zig library with a C ABI, compiled natively or to WASM.

@@ -32,9 +32,9 @@ entirely with AI assistance. A few specific goals shape its design: Claude and reviewed by a human. The project tests how far AI can carry the heavy lifting of spec interpretation, test coverage, and implementation correctness on a non-trivial domain. -- **Spec adherence first.** The goal is to implement S-57 decoding, S-101 portrayal, and S-52 - display as faithfully as possible, using the actual IHO spec documents and the official - Portrayal Catalogue — not approximations or shortcuts. +- **Spec adherence first.** The goal is to implement native S-101 and S-57 decoding, S-101 + portrayal, and S-52 display as faithfully as possible, using the actual IHO spec documents + and the official Portrayal Catalogue — not approximations or shortcuts. - **Cross-platform via Zig.** Zig's build system and cross-compilation support let the same core compile to native (Linux, macOS, Windows) and **WASM** without code changes. Go and Zig @@ -59,14 +59,17 @@ entirely with AI assistance. A few specific goals shape its design: --- -**tile57** decodes NOAA/IHO **S-57** ENC cells and generates **vector tiles** by -`(z, x, y)` — MapLibre Tiles (MLT, the default; MapLibre GL JS ≥ 5.12 -decodes them natively) or Mapbox Vector Tiles — running the -official IHO **S-101 Portrayal Catalogue** in embedded Lua to produce S-52 -nautical portrayal. Alongside the tiles it emits a **MapLibre GL style** and the -portrayal **assets** it references — colour tables, line styles, and the sprite -+ area-fill pattern atlases — so a renderer like -[MapLibre](https://github.com/maplibre/maplibre-native) can draw a chart directly. +**tile57** reads native IHO **S-101** ENC charts (S-100 Part 10a) *and* legacy +NOAA/IHO **S-57** ENC cells — the format is detected from the `.000` file itself — +and generates **vector tiles** by `(z, x, y)`: MapLibre Tiles (MLT, the default; +MapLibre GL JS ≥ 5.12 decodes them natively) or Mapbox Vector Tiles. A native +S-101 dataset feeds the portrayal engine directly; an S-57 cell is converted to +the S-101 model first. Either way, the official IHO **S-101 Portrayal Catalogue** +runs in embedded Lua to produce S-52 nautical portrayal. Alongside the tiles it +emits a **MapLibre GL style** and the portrayal **assets** it references — colour +tables, line styles, and the sprite + area-fill pattern atlases — so a renderer +like [MapLibre](https://github.com/maplibre/maplibre-native) can draw a chart +directly. It holds only its working set: @@ -83,13 +86,18 @@ It holds only its working set: ## Pipeline +Both source formats converge on the same S-101 feature records — a native S-101 +dataset produces them directly; an S-57 cell is adapted into them: + ``` -S-57 ENC cell (.000) - │ ISO 8211 decode src/iso8211/ - ▼ -S-57 feature + geometry model src/s57/ - │ adapt S-57 → S-101 features src/s101/ (adapter) - ▼ +S-101 ENC (.000) S-57 ENC cell (.000) + │ ISO 8211 decode │ ISO 8211 decode src/iso8211/ + ▼ ▼ +S-100 spatial + feature S-57 feature + geometry src/s57/ · src/s101/ + records model + │ assemble to S-101 │ adapt S-57 → S-101 (native.zig / adapter.zig) + └──────────────┬──────────────┘ + ▼ S-101 feature records │ S-101 portrayal (embedded Lua) src/portray/ + rules ▼ @@ -100,10 +108,14 @@ render Surface ──► MVT / MLT tiles (src/tiles/) + MapLibre style.json + └───► PNG raster / vector PDF / terminal text (src/render/) ``` -The stages are separate Zig modules — `iso8211`, `s57`, `s101`, `tiles`, -`render`, `scene`, `style` — pure Zig with no libc; only the Lua portrayal -(`portray`) and the sprite rasterizer (`sprite`) pull in C. See -[the architecture docs](docs/docs/architecture.md). +A native S-101 chart is read straight into the S-101 model — its in-band code +tables already carry the S-101 class and attribute names — so no conversion runs; +its `.001…` update files are applied on load. An S-57 cell is read into the S-57 +model and adapted (a best-effort, S-65-guided step; see +[limitations](docs/docs/limitations.md)). The stages are separate Zig modules — +`iso8211`, `s57`, `s101`, `tiles`, `render`, `scene`, `style` — pure Zig with no +libc; only the Lua portrayal (`portray`) and the sprite rasterizer (`sprite`) pull +in C. See [the architecture docs](docs/docs/architecture.md). ## Use it from Zig @@ -151,6 +163,8 @@ and the asset/atlas generators. See [the C API docs](docs/docs/c-api.md). The offline tool bakes charts and emits portrayal assets: +Any `.000` — native S-101 or S-57 — works everywhere; the format is auto-detected. + ```sh zig build # builds zig-out/bin/tile57 tile57 bake CELL.000 -o out/ # one cell -> out/tiles/.pmtiles + partition.tpart @@ -159,6 +173,7 @@ tile57 assets -o assets/ # colortables + linestyles + sprite tile57 png ENC_ROOT --view -76.48,38.974,15 --size 1600x1200 -o chart.png tile57 pdf ENC_ROOT --view -76.48,38.974,15 --size 1600x1200 -o chart.pdf tile57 ascii CELL.000 --view -76.48,38.974,13 --ansi --tui # the chart in your terminal +tile57 s101 CELL.000 # inspect a native S-101 dataset ``` ## Build diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md index 5f1f09b..5f4b349 100644 --- a/docs/docs/getting-started.md +++ b/docs/docs/getting-started.md @@ -13,7 +13,9 @@ uses the engine from Zig and C. It assumes you have finished ## 1. Bake a chart with the CLI The `tile57` binary is the offline tool. It bakes ENC charts to PMTiles and emits -the portrayal assets a renderer needs: +the portrayal assets a renderer needs. Every `CELL.000` below can be a native S-101 +chart or an S-57 cell — the format is detected from the file, so the same commands +work on either: ```sh zig build # builds zig-out/bin/tile57 @@ -39,6 +41,7 @@ $T pdf CELL.000 --view -76.48,38.974,15 --size 1600x1200 -o chart.pdf # Inspect / summarise $T inspect out/tiles/US5MD1MC.pmtiles # zoom range + tile counts for one chart $T cell CELL.000 # summarise an S-57 chart +$T s101 CELL.000 # inspect a native S-101 dataset $T version ```