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:
13
pipeline/create-map.ts
Normal file
13
pipeline/create-map.ts
Normal 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);
|
||||
Reference in New Issue
Block a user