Skip to content

Hansel project import ​

Lab CLI that turns a Hansel project.json into SafeCall locations, floors, beacons, and a nodes/edges corridor graph. Ariadne already consumes that graph from the navigation snapshot.

Maps stay on disk. Copy floor rasters onto the lab install yourself. Never commit JPGs/PNGs or mar.json.

Command ​

sh
bun server/scripts/import_hansel_project.ts \
  --json <project.json> \
  --db <path-to-safecall.db> \
  [--replace] \
  [--snap-px 20]
  • --replace deletes the existing location with the same project name (and its floors, beacons, nodes, and edges) then re-imports.
  • Without --replace, the script aborts if that location name already exists.
  • Floor primary keys are new AUTOINCREMENT ids (Hansel floor -1 is not reused).

Stdout prints location_id, counts, and Hansel map / end_user_map filenames to copy into the lab maps/ directory.

The old server/scripts/import_navigation_beacons.ts stub only prints this command. Do not feed it mar.json.

Which JSON ​

SiteFileShape
CEDR (AKESO)/Users/tmin/Code/archive/old_safecall_files/legacy/hansel/server/projects/AKESO-CEDR/project.jsonServer: beacon x/y, corridor paths (p1/p2). Already in deployment-map pixels.
MultiscanGretel lib/project.json or Hansel editor exportEditor: beacon location_x/location_y, corridor active_regions.

Do not import an unconverted CEDR editor file and do not re-run Hansel convert_coords.js affine tables. That remap is already applied in the CEDR server project.json.

Raster archives (operator copy, not git):

  • /Users/tmin/Code/archive/old_safecall_files/legacy/hansel/server/projects/AKESO-CEDR/images/ (canonical; includes 4. NP PNGs)
  • /Users/tmin/Code/archive/old_safecall_files/legacy/hansel/back/projects/AKESO-CEDR/images/ (incomplete — mostly 1. NP)

Human checklist: OA-AT-maps. Walk-through: POC replay.

Snap ​

Hansel corridors are axis-aligned but endpoints often do not coincide. The importer snaps H/V intersections and T-joins within 20 px (override with --snap-px). Edge weight is Euclidean length in map pixels. Beacon connections are not imported.

After import, GET /navigation/mobile/snapshot (or the location bundle) includes the new nodes and edges.