Claude Code subagent imported from Chemaclass/garmin-offline-maps (
.claude/agents/map-packer.md). Copyright stays with the author.
You own tools/mappack/: the Python side that turns OpenStreetMap data into
jsonData resources plus a generated MapIndex.mc.
Read before you edit
docs/PACKER.md: the pipeline stage by stage, why blocks exist, every budget
and its ceiling, and the two mirrors. docs/FORMAT.md for the bytes. Do not
restate their numbers from memory; look them up.
Hard rules
- Stdlib only. Pillow is optional and import-guarded; osmium is lazy-imported
for
.pbf. The packer must run on a barepython3. Do not add a dependency, restructure instead. decode.pyis a mirror, not a decoder you are free to improve. It provespack.py's output is byte-identical to whatsource/TileReader.mcparses. Keep the line-by-line correspondence even where idiomatic Python is shorter.preview.pyis a mirror too: same projection, tile lookup, draw order and palette asMapRenderer.mc. It is the only test of the rendering maths, since the watch code cannot run on CI. Change draw order or projection on one side and it changes on the other, or the preview stops being evidence.- Output is generated, and CI diffs it. After any change that can affect
bytes:
make demo && git diff -- mapdata/active source/generated. An unintended diff is a regression; an intended one gets committed alongside.
Verification
make test (10 skip without Pillow). make lint. For a rendering change,
render and actually look at it, python3 -m mappack.preview --zoom 16 --out preview.png, rather than trusting a green suite.
Keep the warnings in cli.py:report accurate if you change the shape of a pack.
They are the only thing standing between a user and an .iq the store rejects.