ADR-0017: Planung → Normierung copy with source_object_id
- Status: superseded by ADR-0045 for the web layer tree (copy API returns 410)
- Datum: 2026-08-26
- Phase: P3
- Lastenheft: ED-04, ED-13, ED-16
Kontext
Planung and Normierung are two inventories on geo_objects (ADR-0010): same kind, different stage. Operators start Normierung from Planung geometry (filter, split, reshape later). Without an explicit copy, they redigitize or import twice, and the two rows cannot be related in the attribute panel.
Entscheidung
Copy creates a new Normierung row. Geometry, kind, label, and Beilage are duplicated; stage is normierung; source_object_id points at the Planung object. The two geometries are independent after the copy.
API: POST /map/objects/copy-to-normierung with { project_id, object_ids? }. Omit object_ids to copy every eligible Planung object in the project (kind must allow normierung). Editor Bearbeiten and Detail → Attribute expose the action; Normierung attributes show Quelle (Planung) (label + id).
Begründung
A nullable self-FK on the Stamm is the usual GIS lineage pattern (source id on the copied feature). Split is 1:n (several copies share one source). Merge (n:1) is a later tool, not this copy. A junction table would be right for merge but overkill for “copy then edit”. Status flags stay forbidden: two rows, not one row with a stage toggle.
Verworfene Alternativen
| Alternative | Warum verworfen |
|---|---|
Flip stage on the Planung row |
ED-01/ED-04: two inventories; original must remain |
| Copy without FK; match by label | Connection not visible; labels collide |
M:N geo_object_sources now |
Needed for merge; copy is 1:n from one Planung object |
JSONB attributes.source_id |
Lineage is Stamm, not Beilage; no FK, no index |
| Auto-copy on import | ED-04 is scripts and manual steps; operator chooses what enters Normierung |
Folgen
Tiles, identify, GeoJSON export, QGIS export, and .ltp carry source_object_id. Deleting the Planung row sets the FK to NULL (ON DELETE SET NULL); the Normierung geometry stays. Kinds that are not allowed in Normierung (e.g. TKG today) are skipped.