Commit Graph

446 Commits

Author SHA1 Message Date
Dustin Carlino
360870a72c Refactor convert_osm::Options default settings 2022-06-12 16:35:11 +01:00
Dustin Carlino
d98f18bb18 Create a more careful API for handling one-way roads everywhere, in
preparation for modifying them in the LTN tool.

Regenerated everything. This had some effects on overlapping road
shrinking, mostly positive. Screenshot diffs all changed, since I
switched laptops again.
2022-05-27 17:01:36 +01:00
Dustin Carlino
8f49dddaee Import roads that happen to have trams on them, for Geneva. This was previously breaking in Berlin, but now we can skip over ways with overlapping geometry.
First time regenerating everything on another laptop; there may be some
weird changes unrelated to stuff here (like montlake prebaked data?),
but nothing that seems problematic
2022-05-23 15:42:55 +01:00
Dustin Carlino
5e11e6254b Force Bristol study area to match an LTN project. #916 2022-05-18 12:13:56 +01:00
Dustin Carlino
378ba9b6e6 Fix bug that was causing all maps to be right-handed.
This was broken somewhere around 6974d26cac, but isn't affecting the current data. I must have regenerated everything before the change or something like that.
2022-05-18 11:59:27 +01:00
Dustin Carlino
b4896ee450 Make untrimmed_road_geometry infalliable, in preparation for storing a
PolyLine instead of list of points.

This exposed two edge cases, fixed here:

1) While merging short roads near junctions, we sometimes create a loop.
   Filter it out immeditely.
2) If an OSM way is physically sharing geometry with another one
   invalidly, detect that and discard it much earlier.
2022-05-07 22:02:06 +01:00
Dustin Carlino
6974d26cac Don't create RawRoads too early (before splitting ways into actual segments). Otherwise, we can't enforce invariants on RawRoads properly. 2022-05-07 22:02:06 +01:00
Dustin Carlino
3d738e93e8 Update Seattle OSM data.
The main reason is to unblock osm2lanes cutover by avoiding
https://github.com/a-b-street/osm2lanes/issues/153. A secondary reason
is to pull in fixes in SLU for #818.

But of course grabbing fresh data wasn't straightforward:

- Need to collapse small junction=circular ways just like roundabouts,
  or else Montlake starts gridlocking. And so actually, regenerating all
  maps, in case any happen to use this.
- Had to update a bunch of proposals since OSM IDs changed. I just used
  the automatic repairs with some edits filtered out. Fixing edits
  really is quite tedious when IDs change; we need something more
  robust. (Just give up, describe geometry, and always snap to the best
  match?)
- Had to update the one baked-in traffic signal for similar OSM ID
  reasons, with similar hassle.
2022-05-02 11:04:49 +01:00
Dustin Carlino
136eef3c3b Just rename center_points to osm_center_points to be more clear. https://github.com/a-b-street/osm2streets/issues/2 2022-05-01 21:33:44 +01:00
Dustin Carlino
f72dd62e56 Store lane_specs_ltr on RawRoad, instead of constantly recalculating. https://github.com/a-b-street/osm2streets/issues/2 2022-05-01 19:39:57 +01:00
Dustin Carlino
8244a900cf Refactor constructors for RawRoad and RawIntersection. #893 2022-04-21 14:32:48 +01:00
Dustin Carlino
d386948a13 Import GTFS for São Paulo 2022-04-14 15:19:29 +01:00
Dustin Carlino
54a7b08ee4 Don't run docker and try to import elevation data when importing one-shot maps from the UI. The results with SRTM aren't any good, and for people who happen to have docker, it can be a surprising and slow extra step. 2022-04-12 15:45:50 +01:00
Dustin Carlino
fca2e1bc87 Workaround GTFS snapping problems in Geneva by forcing sidewalks on both sides of oneway roads 2022-03-11 14:35:36 +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
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
741040840a Use pueue to import cities in parallel as separate processes. #326
We need to name elevation directories differently to avoid conflicts
2022-02-10 16:02:43 +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
bd340a1970 Switch from std::fs to fs_err. When files aren't found, the error message actually includes the path! 2022-01-17 17:30:51 +00:00
Dustin Carlino
e1d0604718 Reduce the number of points along curvy roads. When they're tagged in OSM too close together, it explodes PolyLine shifting. #833 2022-01-06 17:27:10 +00:00
Dustin Carlino
b45bf869b7 Populating the map_model transit representation from the raw GTFS data. #372 2021-12-07 03:10:38 -08:00
Dustin Carlino
82471dd9d6 Optionally dump the extracted GTFS data as a shapefile to visually debug. #372 2021-12-07 03:10:38 -08:00
Dustin Carlino
98e0a56120 Extract some GTFS data and put it in RawMap. #372 2021-12-07 03:10:38 -08:00
Dustin Carlino
8318bbf5d2 Fix clippy warnings. [rebuild] [release] 2021-12-05 12:29:35 +00:00
Dustin Carlino
258ed1c156 Download GTFS for Seattle and SF. #372
Not uploading the downloaded files yet, on a weird connection.
2021-11-19 10:38:01 -08:00
Dustin Carlino
fa5e1e4e95 Match OSM crosswalk nodes more carefully. #795
Some redundant internal points along a road are removed, but sometimes
these are crossings.
2021-11-18 13:16:44 -08:00
Dustin Carlino
c13ca2d20b
Rip out all old broken code for importing OSM bus stops and routes. #372 (#808)
This code stopped working around July 2020 when I attempted to tackle #190. It's sat dormant since then, with most bus and light rail routes not imported correctly at all. I'm going to (eventually) start another attempt at public transit in A/B Street by treating GTFS as the main source of truth, not trying to understand route relations mapped in OSM. It's simplest to just rip out all this old code first. Some of it may be useful later, but version control preserves it.

Regenerating everything; this is a binary format change.
2021-11-17 18:51:59 -08:00
Dustin Carlino
68d9616875
Use simple Rust code to specify map importing config, instead of conf… (#807) 2021-11-17 15:52:09 -08:00
Dustin Carlino
fd10ea74dc Add configuration to filter the auto-generaed crosswalks to only exist
near OSM highway=crossing nodes. #795

Not enabled anywhere, because it doesn't seem to produce good results.
Possibly footway=crossing ways need to be used for this as well.

Had to regenerate all maps, since the binary format changes.
2021-11-08 20:08:49 -08:00
Dustin Carlino
f615acc1f0 Increase the distance threshold for collapsing roundabouts. The tiny traffic circle ones prevent merging adjacent blocks and are causing headaches. #75
Regenerating everything...
2021-11-02 19:06:09 -07:00
Dustin Carlino
9f86365cf6 Upgrade to rust 1.56 and cutover to rust edition 2021 2021-10-21 09:38:06 -07:00
Dustin Carlino
ea0440b6b2 Import fresh Seattle OSM, with the new Northgate station and bridge!
lakeslice gridlocks, because a traffic signal marked on a footway near
23rd and Judkins gets assigned to an alleyway. Worth fixing later.

And wallingford crashes the sim; I think more lane-changing bugs
exposed. It's kind of freeing to not worry about maintaining the
simulation right now...
2021-10-04 18:35:42 -07:00
Dustin Carlino
ca4ddeb7a5 Delete 3 old scripts used to mass-import maps. #745 [rebuild] 2021-09-17 18:29:23 -07:00
Dustin Carlino
4547395067 Move the cycleway snapping step to happen just before RawMap->Map, so we can play with it in the map_editor. #330 2021-07-27 11:20:57 -07:00
Dustin Carlino
163244ace9 Trim dead-end cycleway and service road stubs. Not regenerating yet, but
spot checked in Tempe and the UDistrict.
2021-07-27 11:13:47 -07:00
Dustin Carlino
c28fef1752 By the power of my Mammal Hands, I will figure this out. #654 2021-07-19 15:07:10 -07:00
Dustin Carlino
e6f72449f4 Some fixes to get the Arboretum trails connected.
- Grab fresh Seattle OSM, picking up https://www.openstreetmap.org/changeset/108071529
- Treat highway=footway, bicycle=dismount as a cyclepath, for now
- Treat service=driveway, bicycle=designated as a cyclepath

Since this requires regenerating all maps anyway, also include some
stuff to improve Aurora near Green Lake:

- stop making highway lanes super wide by default; they just make
  divided highways overlap themselves
- filter out service roads with access=customers

But note the bridge from the Arboretum to Lynn is still disconnected,
because of detailed footway mapping that isn't tagged as
bike-accessible.
2021-07-18 20:52:41 -07:00
Dustin Carlino
d142b4fbd0 Refactor lots of the places walking along a PolyLine with a step size
Verified no behavioral change using the screenshot test. (Which only had
the driveway diff from b3ce53aa5f)
2021-07-16 14:17:08 -07:00
Dustin Carlino
38be4c0f68 Fixing small style/clippy problems and kicking off a [rebuild] [release] 2021-07-13 22:52:56 -07:00
Dustin Carlino
a1a97877a5 Better snapping heuristic: if only a small section of a cyclepath is close to a parallel road, don't snap it at all. #330 2021-07-13 17:55:58 -07:00
Dustin Carlino
9237afb439 Revive cyclepath snapping. #330
Several ways to output the results:

1) just write OSM tags to debug stuff, but keep the ways
2) write a KML file to visualize the perpendicular line checks
3) delete the cycleway and make it an attribute of roads instead

Many problems with the snapping heuristics, but enough progress to
commit disabled!
2021-07-13 15:33:07 -07:00
Dustin Carlino
2224dccda9 Add a tool in the main UI to try to merge junctions. #654
It maintains a JSON file of ways to merge that the importer also uses.
For maps fast to import, this is the nicest workflow. Unlike map_editor,
turns and trimmed roads can also be checked.
2021-07-11 13:19:00 -07:00
Dustin Carlino
1539091453 Import Loop 101, adding an option to skip local roads to cut down map
size.
2021-07-08 10:25:36 -07:00
Dustin Carlino
48076a4c5b Better stop sign placement -- degenerate roads shouldn't get them. Not
sure why this wasn't done before.

Regenerated all maps... but this happens to expose some lane-changing crashes.
2021-06-22 17:05:18 -07:00
Dustin Carlino
8f199177f5 Upgrade to Rust 1.53
- arrays are now iterable directly
- switch to using BTree{Set,Map}::retain!
- a round of clippy
- regenerate scenarios and prebaked data; not sure why, but there's a
  diff
2021-06-17 23:04:35 -07:00
Rémi Lauzier
1a4b997818 Fix some clippy warnings 2021-06-16 16:21:35 -07:00
Dustin Carlino
ef90721741 Fix missing study area polygons on the web. The refactor to Polygon::from_geojson_file introduced filesystem IO to the geom crate. Instead, we need to be explicit about how we do file IO.
Also fix some clippy errors
2021-05-20 14:33:04 -07:00
Vinzent Steinberg
82cbbfdf50 Remove outdated exception 2021-05-15 14:24:08 -07:00
Dustin Carlino
1edbca6509
Refactor most of the places extracting polygons from geojson files (#644) 2021-05-15 09:05:28 -07:00
Vinzent Steinberg
446a21696d
Fix most clippy warnings (#646)
* More conventional spelling of acronym identifiers

* `new` -> `new_state`

* Remove redundant field name

* Remove needless `collect`

* `to_controls` -> `make_controls`

* Simplify long if statement

* Fix module inception

* Simplify chained if let

* Return directly instead of creating a binding

* Disable clippy warning about `borrow` method

Implementing the `Borrow` trait instead would result in excessive type
annotations.

* Fix most remaining clippy warnings

* Allow clippy::type_complexity

* Fix bad merge from web editor

* Run cargo fmt

* Suppress large_enum_variant warnings

* Rename FYI state to ShowMessage

* Fix upper_case_acronyms warnings

Co-authored-by: Dustin Carlino <dabreegster@gmail.com>
2021-05-14 17:31:32 -07:00