a-b-street / a-b-street/osm2streets
Intersection geometry refactor
- Lingua principale
- Jupyter Notebook
- Stelle
- 155
- Fork
- 14
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
There are a few ideas rumbling around for improving intersection geometry code. The current thing is quite a scary mess. In some first attempts to detangle it, I think I've found some smaller cleanup steps that should happen in some order first.
- [ ] Work in-place, instead of taking `InputRoad` and returning `Results`. Every road should have start and end trim distances, which can both be passed in (the results from the previous round) and modified by the algorithm.
- [x] Remove `intersection.point`; it's a meaningless field after the first transformation. We can set the initial intersection polygon guess to be a circle there, maybe.
- [ ] Get rid of `trim_roads_for_merging` and instead store start/end trim distance on every road
- [x] Dedupe `RoadLine`, `Piece`, and maybe `Edge` from #130.
I think some/all of the above should happen before we attempt to remove the intersection geom transformation and instead always keep things updated as we make mutations elsewhere in the codebase.
More dramatic ideas:
- [x] Radically simplify `generalized_trim_back`. We should only look for collisions between adjacent pairs of road edges.
- [x] Revisit the whole `second_half` mess and the problems with two polylines hitting each other at multiple points
- [x] Get rid of the `deduped.sort_by_key` stuff at the end if possible. See what tests break without it. We _should_ be able to produce the polygon points in the correct order, if our input roads are sorted correctly.
- [ ] Make the `pretrimmed_geometry` case less weird. Maybe take the main algorithm and first go update `trim_start` and `trim_end` everywhere. Then have a second method that just produces the polygon from that.
- [x] Reconsider what we do for deadend intersections in general and simplify that method
- [x] Think through `on_off_ramp` from scratch. Maybe this is triggered by `IntersectionKind` now and has nothing to do with highway type. Maybe there are better ideas to generate the geometry here.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.