garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/notes/landmark-kit.md

raw


topic: landmarks rebuilt from measurements and photographs — the kit triggers: [crates/atlas/src/landmark, model_assets.rs, replace_building, crates/atlas/landmarks, kit.rs, gather.rs, score.rs, glb.rs, "atlas landmark", Martinitoren, landmark, "building model", measure.rs, aerial.rs, photo.rs, "photo-pose", "landmark section"] updated: 2026-11-06

Landmarks: the kit

3DBAG draws a landmark the way it draws an office: one reconstructed shell, and the client paints storeys of office windows on it. The Martinitoren came out as a grey 97 m block (2026-11-05, before/after in the commit). The Euroborg was fixed with a generator written for stadiums alone (building-models.md); a generator per building does not scale, so landmarks are written as kits, files a builder (an agent or a person) writes from measurements and photographs, which one compiler turns into the GLB the override store already takes. Deleting the override still restores the shell.

The loop

atlas landmark gather <pand> --name Martinitoren --out dir   # facts.md, photos.md, aerial.jpg, kit.json
atlas landmark build crates/atlas/landmarks/martinitoren.json --out dir
                                    # model.glb, placement.json, score.md, lod3-<x>-<y>.json

facts.md holds the outline in a local frame squared to the building, the laser surface at a metre, a histogram of heights (a tall bar is a ledge) and extent by height. photos.md lists Commons photographs within 300 m whose titles name the building, with the bearing each looks along, so you know which face it shows. Every photo used is credited in the kit's sources.

score.md compares the model with AHN's surface model from above. Read its plan-area-by-height table, not the pixel match. On a 15 m tower half-metre edge effects keep the pixel match near 35% for a model that is right; the area ratio says which stage is too wide or too short. The Martinitoren's first fit was 15–30% too wide at every stage top because the stages taper (buttress set-backs). Fitted widths to the mid-stage area plus a set-back ring brought every height within ~10%, with a mean height error of −0.3 m.

Measuring between the steps (2026-11-06)

atlas landmark section <kit|pand> --heading 90 --through x,y --out dir   # section.md/.png
atlas landmark aerial  <kit|pand> --cm-per-px 5 --out dir                # aerial.png/.md
atlas landmark photo-zoom    --photo p.jpg --at u,v --out dir            # zoom.png
atlas landmark photo-pose    <kit> --photo p.jpg --point u,v=x,y,z … [--from lat,lng] --out dir
atlas landmark photo-measure --pose pose.json --wall x1,y1:x2,y2 --px u,v …
atlas landmark photo-rectify --pose pose.json --photo p.jpg --wall … --top 40 --out dir
atlas landmark photo-overlay <kit> --pose pose.json --photo p.jpg --out dir

All in the kit's local frame, so a number read off one goes into the kit as it is. A pand instead of a kit uses the frame gather gives it.

Parts whose faces lean their own way

A part is either a shape scaled through rings, or layers: the plan at each height. Layers of unequal point counts are resampled by angle round the first layer's centre (samples), so each must be star-shaped about it. gather writes the plan at five heights as convex hulls, which is what the Forum's layers are (2026-11-05: within 5% of the laser's area to 44 m). A hull bridges a courtyard, so the Forum's sunken roof terrace is not drawn. Openings sit on any face, leaning or not: width along the bottom edge, from/to as heights.

The nearby-photo search matches titles, which fails for a name like "Forum": it found fridge magnets. A Commons category (Category:Groninger Forum) is the better source then.

Traps

Previewing without publishing

The lod3 file build writes is what the store would serve. Serve it from a stand-in host on the node that renders, passing every other path through to 3dbag.cartopolis.org, and point the client at it with CARTO_3DBAG_URL. The file is placed by the outline's first vertex, while the store asks the published shells (models::owner_cell), so check the shell cell names the pand.

Publishing

The app's replace_building tool (systems::dev::mcp::agent, over the Midas device link too) makes the Overrides tab's two requests as the signed-in account: the GLB to /api/pipeline/overrides/{pand}/model, then the name, placement (placement.json from build), walls collision and no interior. restore_building deletes it. The account needs building_override, and an agent holds no operator login of its own, so a landmark goes live through a person's signed-in app.

Limits

One flat colour per part and material, no textures (building-models.md). A material may name a finish (formats::lod22::FINISHES): slab for stone cladding, clear for see-through glass (the Forum's railings). Clear glass is a 40 % screen door on the models' inside material, not blending: the cell is one merged mesh and a blended one would need sorting. A kit's window material is named glass and stays opaque, which is why the finish is not called that. A sideways disc or a tilted plate is built from layers (a thin plan shifted between two heights is a leaning plate, as on the Museum). Solid parts are named … wall and need the record's collision set to walls, so the panels behind openings stay walk-through.