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

Propagating changes

オープン
#159 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
tracking issue
主要言語
Jupyter Notebook
スター
156
フォーク
14
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

この issue では、道路ネットワーク変換パイプラインにおける変更の伝播について扱います。主に言及されているファイルは、osm2streets/src/transform/ と operations/ にある collapse_intersections.rs と collapse_short_road.rs です。まず、現在のネットワークデータ構造と、remove_road や collapse_intersection などの操作がそれらをどのように変更するかを理解してください。目標は、変更を追跡し、必要な変換を自動的に再実行するシステムを設計することです。「Done」とは、列挙された不変条件に対応する設計提案または実装を意味します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
backend, tooling
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。