Add per-hex metadata system for scale-invariant classification

Each hex now gets a meta/<q>_<r>.json with stable ID, pixel center
coordinates, pixel bounds, labels, notes, and classification status.
The pixelCenter acts as a scale-independent anchor: when switching from
10 Meilen/Hex to 5 Meilen/Hex, pixelToAxial(meta.pixelCenter, newSize)
maps coarse hexes to fine hexes without re-running classification.

Adds:
- pipeline/build-hexmeta.ts: creates/updates metadata + exports
  data/hexmeta-<map-id>.jsonl (committed, survives git clones)
- pipeline/auto-classify-ocean.ts: pixel-based ocean auto-detection
- pipeline/create-map.ts: one-off DB map entry creation
- extract-submaps.ts: writes meta/<q>_<r>.json during extraction
- data/hexmeta-1.jsonl: 8844 hex metadata entries for Aventurien map 1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Axel Meyer
2026-04-16 10:07:09 +02:00
parent bc7d5a3cc7
commit 12200735bf
7 changed files with 9207 additions and 5 deletions

13
pipeline/create-map.ts Normal file
View File

@@ -0,0 +1,13 @@
import { initDb, getDb, saveDb } from '../server/db.js';
await initDb();
const db = getDb();
db.run(
`INSERT INTO hex_maps (name, image_width, image_height, tile_url, min_zoom, max_zoom, hex_size, origin_x, origin_y)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
['Aventurien 10M/Hex', 8000, 12000, '/tiles/{z}/{x}/{y}.jpg', 0, 6, 40, 0, 0],
);
const rows = db.exec('SELECT last_insert_rowid()');
const id = rows[0].values[0][0];
saveDb();
console.log('Map ID:', id);