Commit Graph

1687 Commits

Author SHA1 Message Date
Dustin Carlino
bd5d93ba84 Wire up a way to override OSM sidewalk widths in basemaps using proposals.
We need this because we have a data source for SMP that we can use with
extra attribution, but not upload to OSM.

This whole commit is gross hacks; going forward, we need a proper
process for upstreaming stuff in OSM.
2022-04-27 10:21:54 +01:00
Dustin Carlino
dff4e17b28 Let the user make edits to switch between marked/unmarked crosswalks! 2022-04-26 16:42:37 +01:00
Dustin Carlino
b64874b92c Simplify the intersection geometry interface, which also simplifies the implementation a bit. #893 2022-04-22 14:58:37 +01:00
Dustin Carlino
d175652149 Refactor all intersection geometry callers to use newer API. #893
This pushes most uses of InitialMap inside raw_map.
2022-04-21 16:15:49 +01:00
Dustin Carlino
8a23b347e5
Save LTN proposals in a more future-proof format (#894) 2022-04-21 04:40:00 -07:00
Dustin Carlino
e1f27ec1f9 Add a smoke test that PT doesn't crash the simulation, and relax a check
to get this test to pass. #372

Now regenerate the maps with PT
2022-04-17 17:14:26 +01:00
Dustin Carlino
237f00d1cc Centralize logic in TransitRoute::all_path_requests. Stop repeating it
in the sim transit layer. Simplify the sim transit state accordingly.

Along the way, temporarily sacrifice tracking the paths taken by transit
passengers -- it wasn't correct before.

Not regenerating maps yet.
2022-04-17 11:13:05 +01:00
Dustin Carlino
d386948a13 Import GTFS for São Paulo 2022-04-14 15:19:29 +01:00
Dustin Carlino
1c05a99969 Try tracing paths more precisely along road edges, even with changing widths. Use in the experimental bus tool. It needs work, but solid start. 2022-04-04 19:12:00 +01:00
Dustin Carlino
33eac8cba8 Transition the old path debugger to using the split Pathfinder for
custom RoutingParams. #852
2022-03-26 09:39:54 +00:00
Dustin Carlino
1126972fdd For roads we predict to get more/less traffic from LTN interventions,
click them and explore specific routes.

UI needs plenty of work.

And the results show plenty of spurious changes not explained by new
filters.
2022-03-25 12:07:23 +00:00
Dustin Carlino
d0f0fcf611 Cache the custom pathfinders in the LTN impact tool. I had trouble with this previously, because it was exposing the RoutingParams bug just fixed. #852 2022-03-25 11:24:18 +00:00
Dustin Carlino
b89e716d0c Serialize all of RoutingParams and regenerate all maps, fixing the main problem from #868 2022-03-25 09:34:22 +00:00
Dustin Carlino
df82f54879 Cache custom pathfinders directly for the LTN route planning tool. #852 2022-03-22 22:25:42 +00:00
Dustin Carlino
3b664ea54e Give callers a way to create and use a Pathfinder directly, not storing
it as part of the Map. #852

This has an immediate use in the LTN rat run calculation -- share the
pathfinder across threads, avoid massive logspam.

There's a much larger refactor in another branch, but just starting with
this.
2022-03-21 12:58:20 +00:00
Dustin Carlino
36ef6d6b34 When merging blocks, try reversing the order of one. Otherwise, the
current mix of clockwise and counter-clockwise blocks don't combine.
2022-03-16 12:47:08 +00:00
Dustin Carlino
a266d91632 Import a large slice of central London, minus buildings, for an LTN demo. 2022-03-12 22:21:48 +00:00
Dustin Carlino
99747ff34e Make the LTN tool more robust to broken blockfinding. #841
Try the cheap validation first. If it breaks, fall back to the expensive
version.
2022-03-05 17:21:54 +00:00
Dustin Carlino
1ac25cc39a Find thick dual carriageway roads that overlap, and cut their width in
half.
2022-03-05 11:03:23 +00:00
Dustin Carlino
a421eaf900 Don't attempt to trace blocks around bridges/tunnels at all in Lyons, avoiding a crash there. #857 2022-03-01 15:24:59 +00:00
Dustin Carlino
cbfe2265bb When detecting existing filters in OSM, use the road length after the edit has been applied. Found in Leeds. 2022-03-01 13:02:29 +00:00
Dustin Carlino
23cf7c8d0c Detect incorrectly merged perimeters MUCH faster. #841 [rebuild] [release] 2022-02-26 20:24:32 +00:00
Dustin Carlino
460c03e75c Trace blocks starting from roads without sidewalks on both sides 2022-02-24 20:10:33 +00:00
Dustin Carlino
82dff217a5 When the lasso tool is active, change the panel to explain the interaction 2022-02-24 09:33:12 +00:00
Dustin Carlino
13f3a7af73 Add a tool to quickly expand an LTN boundary by freehand lasso. #857 2022-02-24 09:33:12 +00:00
Dustin Carlino
9c0aedb575 When we can help it, don't shift road polylines twice. #860 2022-02-23 18:46:42 +00:00
Dustin Carlino
2890e6efcc Make the RawMap APIs for working with road center-lines less obnoxious 2022-02-23 15:27:27 +00:00
Dustin Carlino
03b6f39763 Flatten the raw_map initial module now 2022-02-19 17:48:39 +00:00
Dustin Carlino
14bea3a4be Split out a raw_map crate from map_model. RawMap is the thing we turn
OSM and other raw input into and store, before later converting to a
Map.

Why?

- build-time performance: while iterating on geometry problems, map_editor in release mode took 33s to build before, 11s now that the crate is split
- better layering: operations on a RawMap are becoming increasingly distinct from later transformations on the bigger map model
- this helps tease apart the dependencies of the intersection polygon algorithm for #846
- this will make it simpler to cutover to osm2lanes for https://github.com/a-b-street/osm2lanes/issues/71

There's further reorganization in raw_map and map_model that'll follow,
but the main work is done here.
2022-02-19 17:39:28 +00:00
Dustin Carlino
6a5366292f Make editing maps with transit stops a little more resilient. #372
Transit stop IDs previously were tied to LaneIDs, but those can easily
change with edits to the number of lanes on a road. We still may need to
re-snap transit stops (if the driving position or sidewalk changes), but
this prevents one more common type of problem.

This requires regenerating everything, since it's a binary schema
change...
2022-02-17 20:18:24 +00:00
Dustin Carlino
0dc8972187 Fix editing maps that have public transit. #372
Back in #819, I broke things by creating the sidewalk+transit graph
before transit routes had been set up. This causes immediate crashing
when editing the 2 maps with transit (Arboretum and SF).
2022-02-17 19:35:46 +00:00
Dustin Carlino
9054666a0b Use RDP simplification to road center-lines when we glue them together after collapsing degenerate intersections. This is a followup to #833.
And clean up some other things that RDP does better.

Fallout from regenerating everything:

- Enfield borough crashed, so removed it
- All UK scenarios are now much bigger, due to the changes in #853 being
  picked up
- Poundbury gridlocks now due to that
2022-02-10 14:40:11 +00:00
Dustin Carlino
3de1ab3d9d Detect existing modal filters in OSM and represent them more directly. #851 2022-02-09 15:59:04 +00:00
Dustin Carlino
b06129da58 Add a way to temporarily flag off the slower blockfinding from #841 while working on maps that don't have the problem. 2022-02-04 10:07:54 +00:00
Dustin Carlino
e5704f4a6d Prevent many cases of blocks with overlapping geometry or that extend
too far, by not trying to trace near railways or cycle-only
bridges/tunnels. This is an imperfect heuristic, but it makes
significant progress in most maps.
2022-01-31 16:03:21 +00:00
Dustin Carlino
f8dfe32c04 Save LTN edits to files and load from CLI. No proper UI yet, and the
format isn't future-proof at all.
2022-01-31 13:30:55 +00:00
Dustin Carlino
e21c57b70a When calculating traffic volumes, deduplicate path requests first.
Around 2x less paths to calculate.

Even though the deduplication throws away some info, the net effect for
measuring traffic volumes is practically equivalent, so it's a
worthwhile optimization. Used the new comparison UI to verify that!
2022-01-27 14:26:36 +00:00
Dustin Carlino
dfbd9785f3 While merging adjacent perimeters for the LTN tool, don't proceed if
intermediate results can't be turned into a polygon. It'll break
something later. #841

There's a particular bug where a perimeter can be turned into a polygon,
but after collapsing internal dead-ends, it can't.

If we don't do this, the LTN select boundary UI crashes, and reasoning
about block -> neighborhood mappings gets very hairy. I'd like to
address all the root causes of failing to make a polygon, but until
then...

TRADE-OFF: it _really_ slows down the select boundary UI.
2022-01-25 18:12:15 +00:00
Dustin Carlino
eba579dbd1 Adjust the definition of cycleway roads to include sidewalks. Any road
with only bike lanes and any walkable lane counts as a cycleway, for
rendering purposes. So if you change a road with sidewalks to only allow
bikes on the road, it shows up green in the unzoomed layer.

There's lots of nuance with footways that doesn't matter yet, because
we're mostly not importing those yet.
2022-01-25 14:10:39 +00:00
Dustin Carlino
e36337a91f Use an enum for a more clear API to handle caching temporary
pathfinders. Should be no behavior changes yet
2022-01-23 09:37:45 +00:00
Dustin Carlino
1a05da2824 Change how pathfinding works when avoiding modal filters.
Before, it was just a large 3 hour penalty for crossing a filter -- so
it shouldn't happen, but it was possible, and so some (but not all!) LTN
code had an extra paranoia step to filter out paths that crossed.

Now, actually make it impossible at the pathfinding layer.

Also, fix colors in the LTN pathfinding tool that were backwards
2022-01-23 09:37:45 +00:00
Dustin Carlino
a14d6b3810 Better errors when core Line stuff breaks.
... and plumbing it everywhere
2022-01-18 10:26:33 +00:00
Dustin Carlino
3a60a465e0 Remove blocks from the current neighborhood, possibly creating a new one
The code is quite a mess, but it works...
2022-01-15 17:52:38 +00:00
Dustin Carlino
8ff4c41ea1 Some useful debugging / correctness steps towards more robust blockfinding. [rebuild] [release]
I have another branch that handles roads without sidewalks on one side
-- it helps in some cases, but regresses in others, so not merging it
yet. But taking a smaller step and bringing in some stricter common
endpoint logic from there.

Bringing in some useful intermediate changes
2022-01-09 11:07:10 +00:00
Dustin Carlino
85709b1e4f Workaround #834, which was causing partitioning to infinite loop when
there are disconnected railway segments dangling around
2022-01-06 13:25:16 +00:00
Dustin Carlino
cb3138dbfe When turning a perimeter into a block polygon, don't insist on tracing
along the perimeter of broken intersections.

There are cases where intersection geometry is a little bit broken,
jutting out a bit and touching a road. It's more robust to still produce
a reasonably shaped block in these cases, instead of totally give up.

Visual inspection and the goldenfile VASTLY improved!
2022-01-06 11:22:06 +00:00
Dustin Carlino
2356cee1db When tracing perimeters, allow doubling back at a dead-end with exactly
1 lane (usually a cycleway or footway). This correctly produces a few
more blocks in some maps -- as the goldenfile diff (and manual
verificaton) shows!

Also allow jumping from LTN browse to debug mode, to conveniently work
on blockfinding problems.
2022-01-06 10:16:11 +00:00
Dustin Carlino
8d0b891406 Prevent neighborhood_containing from crashing in North Leeds. [rebuild] [release] 2022-01-02 17:48:25 +00:00
Dustin Carlino
7d6f133f1c Make the LTN tool handle roads that already ban cars.
- Don't allow filtering them
- Don't cross them when calculating cell connectivity
- Create special green cells for them, and don't count towards the
  disconnected warning
2021-12-31 16:28:51 +00:00
Marcel Dejean
6691a28aae Delete the crosswalk at degenerate i's with sidewalks on one side 2021-12-28 00:05:12 +00:00