Skip to content

Report what a path holds by opening the files in it - #75

Merged
beetlebugorg merged 1 commit into
mainfrom
feat/inventory
Sep 6, 2026
Merged

Report what a path holds by opening the files in it#75
beetlebugorg merged 1 commit into
mainfrom
feat/inventory

Conversation

@beetlebugorg

@beetlebugorg beetlebugorg commented Sep 6, 2026

Copy link
Copy Markdown
Owner

A host importing charts had to decide from a file name what it could hand over, and every host that did so rejected charts this engine reads. S-101 names are longer than S-57 names, and the S-164 test sets put digits and an underscore where a producer code was assumed.

tile57_inventory_open looks through one file or a directory and reports a row per file that looks like a chart: kind, standard, cell name, edition, scale, coverage, bytes, and a reason for one it cannot open. Two steps, and only the first reads a name. An extension shortlists the files to open (.000 through .999, .pmtiles, .mbtiles, .kap, .bsb), then the file states what it is, through peekAnyInfo for a dataset, openPmtilesPath for a baked archive and RasterChart.open for a picture chart. A shortlisted file that turns out to be something else is TILE57_FILE_OTHER with a reason. CATALOG.031 reports that way.

An exchange set still in its .zip is out of scope here, because reading an entry means inflating it and the listing alone cannot say what an entry holds.

src/chart.zig is registered for tests. No test step collected it: the engine imports it as a module, and a module import does not pull another module's test blocks in, so its four tests had never run. They pass.

Checks

zig build, zig build test (433 tests) and zig fmt --check pass.

Over the test data on this machine, with T57_INV_DIR naming each folder: the S-101 1.2 set inventories to 32 source rows, standard s101, with names and scales from the datasets; S-164/TestDataSets/2.2.5 Good Base Cells to one source row, 10100AA_X01SW, scale 22000; S-164/LogsDumps, holding 72 xml and 45 log files, to no rows; a folder of S-57 cells to three source rows with their scales; a folder holding one baked archive to one baked row, scale 12000.

Each new test was made to fail once, to check the suite names it.

Base automatically changed from fix/ingest-extent-scale to main September 6, 2026 23:07
A host importing charts had to decide from a file name what it could
hand over, and every host that did so rejected charts this engine reads.
S-101 names are longer than S-57 names, and the S-164 test sets put
digits and an underscore where a producer code was assumed.

tile57_inventory_open looks through one file or a directory and reports
a row per file that looks like a chart. Two steps, and only the first
reads a name: an extension shortlists the files to open, then the file
states what it is, through the leading-record peek that already reads a
dataset's standard, name, edition and scale. A shortlisted file that
turns out to be something else is TILE57_FILE_OTHER with a reason.
CATALOG.031 reports that way.

src/chart.zig is registered for tests. No test step collected it: the
engine imports it as a module, and a module import does not pull
another module's test blocks in, so its four tests had never run.
@beetlebugorg
beetlebugorg merged commit b2aef2d into main Sep 6, 2026
4 of 5 checks passed
@beetlebugorg
beetlebugorg deleted the feat/inventory branch September 6, 2026 23:26
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