a-b-street / a-b-street/osm2streets

Propagating changes

Offen
#159 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
tracking issue
Vorherrschende Sprache
Jupyter Notebook
Sterne
156
Forks
14
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

There are a few cases today where it's the caller's responsibility to restore invariants after one operation:

1) After `remove_road`, it's possible an intersection will be left orphaned, with no roads pointing to it. Those must be removed. https://github.com/a-b-street/osm2streets/blob/a9021348abded03cbedbdb77b382aafd52e6a37f/osm2streets/src/transform/collapse_intersections.rs#L123 is one place I just added to manually fix this.
2) `update_movements` has to be called when anything connected to an intersection changes
3) `update_center_line` needs to happen when `reference_line` changes
4) `collapse_short_road` may produce a loop-road that should get removed later. https://github.com/a-b-street/osm2streets/blob/a9021348abded03cbedbdb77b382aafd52e6a37f/osm2streets/src/operations/collapse_short_road.rs#L119

I'm working on a 5th, regenerating intersection geometry + trims.

Relatedly, I forgot where, but there's some branch where I can improve final geometry, but only by rerunning some transformations after generating intersection geometry. That process calculates trims, discovers roads too short to exist, and then we [collapse short roads again](https://github.com/a-b-street/osm2streets/blob/a9021348abded03cbedbdb77b382aafd52e6a37f/osm2streets/src/transform/mod.rs#L43). There's a case where if we `CollapseDegenerateIntersections` after that, we make even more progress somewhere.

An idea that's arisen somewhere before is to do more granular change tracking. Low-level operations like `remove_road` and `collapse_intersection` can precisely say which roads and intersections they touch. We could make a helper track those changes, and re-run transformations and operations on modified things. How exactly should that work? Should every transformation right now be re-expressed to operate on just a piece of the network, and we have some rules about retrying all transforms when something changes? Just starting this issue to brainstorm

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Das Issue behandelt die Weitergabe von Änderungen in der Transformationspipeline des Straßennetzwerks. Die wichtigsten genannten Dateien sind collapse_intersections.rs und collapse_short_road.rs in osm2streets/src/transform/ und operations/. Beginne damit, die aktuellen Datenstrukturen des Netzwerks zu verstehen und wie Operationen wie remove_road und collapse_intersection sie verändern. Ziel ist es, ein System zu entwerfen, das Änderungen nachverfolgt und notwendige Transformationen automatisch erneut ausführt. „Done“ bedeutet einen Designvorschlag oder eine Implementierung, die die aufgeführten Invarianten erfüllt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
backend, tooling
Issue-Typ
Refactoring
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.