Commit Graph

428 Commits

Author SHA1 Message Date
Dustin Carlino
9984648379 Treat bicycle=designated on footways the same as bicycle=yes. And update Seattle OSM data again to pick up my fixes from yesterday. #330 2021-02-27 13:01:37 -08:00
Dustin Carlino
3a63c11303 Treat footways that allow bikes the same as the other shared-use trails. #330
This gets most of the Burke (and other trails) imported, though there
are still some lingering connectivity problems.
2021-02-26 17:23:21 -08:00
Dustin Carlino
603717a560 Remove the separate_cycleways experiment flag. Always import cyclepaths
mapped as separate OSM ways in all maps!!! #330
2021-02-26 14:58:57 -08:00
Dustin Carlino
601d367c32 Import highway=track as a separate cycle+footway. We identified https://www.openstreetmap.org/way/842138587 that really affects the Poundbury site. 2021-02-25 12:59:48 -08:00
Dustin Carlino
fa515054fb lcid was missing a friendly map name
and adjust the elevation query format
2021-02-24 17:26:23 -08:00
Dustin Carlino
737019a9ec Emit a file with points to query for an elevation service. #82 2021-02-24 15:58:10 -08:00
Dustin Carlino
6ceac88cbe Import most service roads, except driveways. #449
Added an extra step to classify service roads as running through a
parking lot, to prevent them from being treated as regular roads.

Had to fix up a few prebaked traffic signals. lakeslice falls back into
gridlock; will fix separately -- too much effort behind this change to
stop.
2021-02-21 18:27:34 -08:00
Dustin Carlino
bc2767b89e Refactor lots of places that construct paths to the data/input dir, which is always organized by city. This would've made the previous change way easier. #326 2021-02-13 18:30:01 -08:00
Dustin Carlino
39f5d50fcd The grand country split. #326
City names are now disambiguated by a two-letter country code. This
commit handles almost everything needed to make this transition. Main
next steps are fixing up map edits automatically and making the city
picker UI understand the extra level of hierarchy.

A little bit of fallout: lakeslice gridlocks again; this regression is
actually from the recent traffic signal changes, but I'm just now
regenerating everything. Will fix soon.
2021-02-13 15:45:59 -08:00
Michael Kirk
4b665c871d
update geo related deps. (#508)
geo-types to 0.7
geo to 0.17 which removes redundant old geo used by polylabel
geojson to 0.22
2021-02-08 16:34:56 -08:00
Dustin Carlino
4235d9f994 When importing maps, optionally add in extra buildings from a GeoJSON
source to augment the ones in OSM. For
https://github.com/cyipt/actdev/issues/53 -- sometimes the buildings
just haven't been mapped in OSM yet, other times the buildings are part
of a future development site. In either case, we can procedurally
generate some houses, so this is a way to include them in the map.

Start doing this for Chapelford. But first, adjust the generated house
sizes -- they were WAY too tiny.

Also prep for [rebuild] [release]
2021-02-07 13:56:26 -08:00
Dustin Carlino
73e405e382 Upgrade most dependencies 2021-02-03 18:13:06 -08:00
Dustin Carlino
341ce834e3 Based on startup params, display an extra 'study area' on the map. cyipt/actdev#44 2021-01-27 13:00:48 -08:00
Dustin Carlino
c10dc4a696 Collapse tiny little traffic circles into a single intersection, for
saner geometry and simulation. #446, #75

This partly reverts b3bfd6a3f2.

Also bring in fresh OSM data for Seattle.
2021-01-26 17:43:15 -08:00
Dustin Carlino
fa70816bfa Attempt some transformation of sidewalk:{left,right} tags for #449.
Fix a bug with the previous commit (lanes=1 on a two-way). Now regenerate.

... Unfortunately lakeslice now gridlocks due to a turn generation bug.
Temporarily removing the prebaked results there so I can push these last
few changes through. Will resolve this before the next release.
2021-01-25 15:31:01 -08:00
Dustin Carlino
f69335edf0 Let individual maps override the street parking length. #457
Now regenerate all map data, because the schema changed. Also had to
revert part of the last commit to unbreak transit route snapping in
Berlin.
2021-01-25 12:36:49 -08:00
Dustin Carlino
e7e8bb2ca0 Fix a bug with matching traffic signals tagged along a way to the
intersection. When the signal happened to be on a node that didn't alter
the angle of the road, it was incorrectly getting dropped before.

Not regenerating all map data just yet, but manually verified along
Newmarket Rd in Cambridge. #449
2021-01-25 10:04:02 -08:00
Dustin Carlino
c9c6f240ae Remove timer.{note, warn, error} in favor of the log crate. #262
Originally, the intention of the deleted calls was to not interrupt
Timer progress bars with warnings. But the output of things like the
importer is impossible to read anyway. Strongly considering explicitly
sending logs and timing info to separate places and using something like
multitail for live progress.

Unplumb timer from LOADS of places that just needed it for logging.
2021-01-21 19:22:02 -08:00
Dustin Carlino
4c6d7af76d Bring in linear pedestrian highways as cycleways+shoulders. #458
Also give living_streets in Krakow shoulders, so foot routing works
better there.

Now regenerate everything. Actually messes up routing for Trumpington;
71 cancelled trips up to 101. And have to intervene to keep lakeslice
not gridlocking, as usual.
2021-01-16 17:03:13 -08:00
Dustin Carlino
ec8c37ab05 Import pedestrian plaza areas, just for rendering. #458
Not regenerating everything yet.
2021-01-16 15:16:14 -08:00
Dustin Carlino
8ec1e5a807 Automatically merge roads based on the inferred length. For now, the
threshold is hardcoded to 0 to disable this, but it can be more easily
changed when experimenting locally.

I tried this out in a few maps manually and saw that it helps sometimes,
but breaks strangely other times. My plan is to work through the bugs
that result and eventually enable this for all imports. #114
2021-01-15 16:53:12 -08:00
Dustin Carlino
0be06d04f9 Switch to maintained version of earcutr.
Since we have to regenerate everything anyway, also start importing
landuse=meadow areas for #449.
2021-01-14 08:29:49 -08:00
Dustin Carlino
a1988f269c Based on importer config, try using separate cyclepaths directly. #330
Small adjustments to unzoomed rendering and stop sign placement.

Regenerate all maps because of the format change, but only Cambridge
changes. Since we're doing this anyway, also pull in leisure=garden.
2021-01-12 11:13:45 -08:00
Dustin Carlino
4e3af638e7 Import landuse=recreation_ground as a park. Noticed Rainier Playfield missing. 2021-01-11 21:23:02 -08:00
Dustin Carlino
ba2bbab2ae When inferring sidewalks on one-ways, don't forget to consider the driving side. 2021-01-11 15:07:22 -08:00
Dustin Carlino
65ee007ece Close a roundabout in lakeslice that keeps causing gridlock. Not regenerating yet. 2021-01-10 18:21:37 -08:00
Dustin Carlino
6e3ce1d9ee Stop generating footways and service road KML files out of Seattle. They're only used for debugging, and not actively. For cities with multiple maps, the order of importing maps causes the files to get overwritten anyway. 2021-01-08 09:44:38 -08:00
Dustin Carlino
eb9bf77bf0 Use roxmltree/std to get an error implementation and make using it more ergonomic 2021-01-05 11:37:48 -08:00
Dustin Carlino
e99def9124 Switch all error handling to anyhow. Nothing consumes our code as a
library yet, so this is a step forward from string errors. Manually
tested how errors show up (including the nice with_context bit).
2021-01-05 11:35:03 -08:00
Dustin Carlino
965d999199 Upgrade misc other dependencies 2021-01-03 20:01:27 -08:00
Dustin Carlino
5c04923dff Split abstio crate out from abstutil. #253
widgetry, geom, and abstutil may wind up on crates.io in some form to
let other projects use widgetry. abstio has A/B Street-specific tricks
for reading data on native/web. Note widgetry still depends on abstio,
will figure out how to clean that up next.
2021-01-02 10:28:00 -08:00
Dustin Carlino
9c63d9a181 Make a quick way of marking roads in the UI, dumping to a list, then
later overriding a .osm file with tags for these roads. This is a way to
test the effects of making simple OSM changes locally before
upstreaming.

Also handle repeated merging collapsing one of the roads. Not 100% what
happens here, but skipping the collapsed road works fine. The scary
Montlake intersections now look great with all the merging done, so
upstreaming the change! #114
2020-12-30 18:31:39 -08:00
Dustin Carlino
b7061ed425 Handle the junction=intersection tag in OSM, representing a short "road"
in the interior of a big intersection. #255, #114

- No sidewalks or parking on it
- Automatically try to merge it

Bring in fresh Seattle OSM with a few places on Aurora tagged, for
further experimentation.

Also, there's some bug in the importer; Seattle maps didn't get
regenerated last change. Picking up the diffs now.
2020-12-28 19:43:40 -08:00
Dustin Carlino
396b9b1969 Infer parking tags better for dual_carriageway=yes. Also stop inferring parking on trunk roads like Aurora. And pull in fresh Seattle OSM, with lots of dual_carriageways tagged. #230 2020-11-14 17:32:34 -08:00
Dustin Carlino
6fe49ce0fa Some preps for importing Paris: avoid crashing on some previously unseen
OSM things, and making geojson_to_osmosis handle multiple polygons in
one input file.
2020-11-13 16:31:22 -08:00
Dustin Carlino
69699600ea Prototype filling in the gaps near one-way roads. Needs more filtering
out, but solid start. #230

Regenerate map data, since the Area object changed.
2020-11-12 14:21:08 -08:00
Dustin Carlino
c96f84341a Incorporate intersection corners in the around-the-block polygon. #230 2020-11-12 13:41:47 -08:00
Dustin Carlino
07ac288e72 Refactor: rename Pt2D::from_gps to just gps.to_pt(bounds) 2020-11-10 12:00:43 -08:00
Dustin Carlino
b0bdbf6c1f Change some cities to just use JSON config for importing, instead of boilerplate-filled code. #326 2020-11-06 10:56:36 -08:00
Dustin Carlino
e0a8d82b61 Reorganize polygon files to importer/config, instead of data/input.
Nothing in data/input should be under version control; all of it is
managed by the updater. #326
2020-11-06 10:10:03 -08:00
Dustin Carlino
89a4e5bdcd Disable output from the snapped cycleways experiment. The output is
nondeterministic (for still unknown reasons) and the spurious diff when
the importer is run is a distraction.
2020-11-05 11:43:50 -08:00
Dustin Carlino
67530bec07 Future-proof file organization by changing map_name from a string to a
struct. Whatever choices we make next about naming cities hierarchially
or not can be managed in just one place. #326

This is a pretty huge change, but the compiler gives reasonable
confidence it's correct. More bugs are likely to crop up in the next
step, when filenames start being namespaced by the city too.
2020-11-04 17:26:32 -08:00
Dustin Carlino
21cd7a197d Run the experimental cycleway snapper phase for Leeds, after adding a
check to skip ways like https://www.openstreetmap.org/way/429285996,
which're unexpectedly loops.
2020-11-03 15:57:21 -08:00
Robin
edf5d0d8a9
Add Leeds (#375) 2020-11-03 10:53:14 -08:00
Dustin Carlino
04b9eef24a When using OSM footpaths, don't stick sidewalks on the road when sidewalks=separate and also bring in cycleways and paths allowing foot traffic. #161 2020-10-30 15:16:19 -07:00
Dustin Carlino
bf0dce2c18 Optionally import sidewalks and separate footpaths exactly as they're in OSM, instead of attempting any inference. This is a way to move forward on #161 without having to cutover to it all at once. 2020-10-30 13:27:45 -07:00
Dustin Carlino
0ddfb201d9 Get some parts of Tokyo to import, by adjusting the filter for city-like
boundaries and by preferring English filenames. #326
2020-10-27 14:10:42 -07:00
Dustin Carlino
004ca95842 Optionally just create a circle of some radius around the 'center' of a city. #326 2020-10-26 16:57:50 -07:00
Dustin Carlino
fda4c4da7b Refactor a few utilities, and use convex hull of the city boundaries to simplify them considerably. #326 2020-10-26 14:15:25 -07:00
Dustin Carlino
30ad6709a8 Create a tool to turn huge .osm extracts into just the cities. The
result isn't quite useful yet; the clipping polygons are massively
complicated. #326
2020-10-26 13:40:22 -07:00
Dustin Carlino
47fa997f72 Refactor a proper Amenity struct. Leave room for optional raw OSM tags.
Don't expose the tags in the UI yet. [rebuild]
2020-10-25 11:49:46 -07:00
Dustin Carlino
39ec4a13de Import forests as park areas (for Salzburg) and add a warning about JOSM. #366 2020-10-15 15:10:12 -05:00
Dustin Carlino
f1ec2fa4c4 Convert more doc comments for abstutil, convert_osm, geom, sim 2020-10-08 21:13:08 -07:00
Dustin Carlino
f258c50595 Organize import blocks using https://github.com/dabreegster/organize_rust_imports 2020-10-05 20:29:22 -07:00
Dustin Carlino
27d94945c6 Manually move mod block after the use block, to match what CLion does. 2020-10-05 20:29:22 -07:00
Dustin Carlino
ac5aa927db Test turn generation via goldenfiles instead. Revert the "import from a
raw string" stuff from the previous commit.

Add tests of a few interesting intersections. The results right now
aren't ideal, but this sets things up for fast iteraton.
2020-10-01 15:34:43 -07:00
Dustin Carlino
ec114e51e1 Prototype an idea for unit testing the turn generation code. Hardcode a
simple .osm, turn it into a full Map, and inspect the results.
2020-09-30 16:30:28 -07:00
Dustin Carlino
5813603594 Include multipolygon parking lots from OSM 2020-09-28 11:39:34 -07:00
Dustin Carlino
4ceb190f6c Add a polygon for Redmond/Kirkland 2020-09-27 12:49:21 -07:00
Dustin Carlino
371d26f707
Bring in alleyways from OSM! [rebuild] (#351) 2020-09-27 12:20:27 -07:00
Dustin Carlino
84891f8b96 Some map fixes to prepare for alleyways:
- Temporarily workaround snap_cycleways crash in Xi'an
- Fix interpretation of blank turn restrictions. https://www.openstreetmap.org/way/739621435 was missing a right turn, which was causing vehicles to do this crazy loop to go from Madison EB to Lake Wash SB.
- Ignore turn restrictions when they don't match the number of lanes. https://www.openstreetmap.org/way/428090702 and similar need some updating.

Regenerate all data, but give up on lakeslice running fully. Going to
sacrifice that one for a bit to get new roads imported.
2020-09-27 11:21:35 -07:00
Dustin Carlino
5a3bee0264
A first attempt to snap separately mapped cycleways to main roads. Emit (#348)
an extra KML file during importing to debug; don't bring into the main
map yet. #330

Not regenerating yet
2020-09-25 15:22:47 -07:00
Dustin Carlino
f610c66572 Remove the weird shifting/angle inversions from DrivingSide. First step
of #311. Tested to not break righthand maps.
2020-09-04 10:01:06 -07:00
Dustin Carlino
4005adecf8 Refactor: create a Direction enum, in preparation for two-way cycletracks on one side of a road. 2020-08-24 13:30:13 -07:00
Dustin Carlino
2c5bbd3e7e Use alternate language building names and amenities, when available. Fixes #271.
Tested in Shinjuku. No substantial file size increase for any maps.
2020-08-20 10:39:28 -07:00
Dustin Carlino
2ebf463635 Handle buildings tagged as parking garages in OSM. 2020-08-19 17:19:54 -07:00
Dustin Carlino
d427893843 Model parking lots with extra un-renderable spots. This fixes #150, lots
without aisles, and #265, multi-story garages.
2020-08-19 17:19:54 -07:00
Dustin Carlino
2e93fdbf54 Fix parking aisle loops that cross the parking lot polygon. Closes #242 2020-08-18 15:12:12 -07:00
Dustin Carlino
83e84c10af Handle more errors in importer. Got the entirety of Taiwan to import...
but the water polygons are so sad. :(
2020-08-15 09:36:23 -07:00
Dustin Carlino
11cefb118a And the same thing for OriginalIntersection
Actually, don't need to regenerate map data. Thanks to the magic of
zero-cost wrapper types, the binary format is the same.
2020-08-13 11:48:13 -07:00
Dustin Carlino
843d24b6ed Refactor: OriginalBuilding should just be OsmID. The purpose of
OriginalBuilding was to refer to buildings in a stable way across
different maps and across OSM updates. Recently, OsmID and friends
appeared. The double layer of wrapping is an annoying API.

Not regenerating map data yet; about to do the same thing for
OriginalIntersection
2020-08-13 11:37:06 -07:00
Dustin Carlino
58849d3d15 Small refactor: in most places, we can actually use String as the error type; Box<dyn Error> is only useful when errors of different types are propagated.
Nowhere in abst do we care about handling different errors differently
2020-08-13 07:12:06 -07:00
Dustin Carlino
3b49353df2 gracefully degrade if we cant make TurnGroups for a traffic signal. this
gets SF, Tokyo, and London to import!!!
2020-08-12 11:05:19 -07:00
Dustin Carlino
62bb82886d blaze through all the crazy errors in intersection_polygon, just
recording errors and falling back to circular geometry and not trimming
roads

also filter out highway areas like
https://www.openstreetmap.org/way/132705692, woops!

Manchester and NOLA now import...
2020-08-12 09:36:46 -07:00
Dustin Carlino
eb74e05407 missed a few right_shift calls in importer. and speed up traffic signal
matching while I'm there
2020-08-12 08:34:35 -07:00
Dustin Carlino
43a6edbc28 regenerate everything, prep for release. [rebuild]
lakeslice still gridlocks and lots of bus routes cut out. not the
happiest release.
2020-08-08 21:33:11 -07:00
Dustin Carlino
ecd5d86009 handle bus stops right at intersections 2020-08-08 19:32:18 -07:00
Dustin Carlino
52e89315d7 in lieu of understanding bus platforms, add a shoulder to some roads with bus stops, now that we know what side of the road with some confidence. fixes 45th and I5. 2020-08-08 18:39:40 -07:00
Dustin Carlino
6c525d625d match transit stops to side of the road based on the orientation of the points in the route. don't use this just yet...
not regerating yet either
2020-08-08 17:44:28 -07:00
Dustin Carlino
94f83dcc6a step 1 of much more sane bus route/stop matching: just get the order of points in a route in a good order
not regenerating yet. this eliminates some routes that were previously
imported (but who knows, maybe not successfully)
2020-08-08 16:51:40 -07:00
Dustin Carlino
d1e9e38e82 refactor for #231: use typed OSM IDs everywhere, dedupe URL code
have to regen, the binary format has changed
2020-08-08 16:09:36 -07:00
Dustin Carlino
49e8ab3680 try to get seoul to import 2020-08-08 09:32:43 -07:00
Dustin Carlino
62ed91925a random fixes in the map importer to try to import a bunch of new cities.
not too successful, but made progress.
2020-08-07 10:24:58 -07:00
Dustin Carlino
128e649236 fix zordering of harbor island, broken in the osm reader refactor a few weeks back
fresh osm. breaks lakeslice, but I'll fix tomorrow. progress in
south/west seattle.
2020-08-06 18:11:09 -07:00
Dustin Carlino
5eefdaef18 still import maps with badly broken OSM geometry. warn loudly, don't
attempt to trim the roads, put a funny circle there instead.
2020-08-06 08:29:08 -07:00
Dustin Carlino
a2bf0ee59f gather footways, service roads, and cyclepaths into kml side input files to start experimenting with snapping to roads. a small step towards #242, #169, #161, #139, etc 2020-08-05 15:19:52 -07:00
Dustin Carlino
3c24b7aa5a pull in spawn times for seattle from gtfs. looks wrong, but it's a
start.
2020-08-05 14:46:37 -07:00
Dustin Carlino
588a20e8d3 reduce warnings in map importer 2020-08-03 16:22:02 -07:00
Dustin Carlino
2979f8117f handle .osm with missing bounds and no clip 2020-08-01 08:51:19 -07:00
Dustin Carlino
b4ad7400df stop drawing center lines for one-ways. while regenerating maps, also
bring in natural=scrub, and rename the krakow map
2020-07-31 20:48:26 -07:00
Dustin Carlino
ec52adce77 dont infer parking on roads in krakow that dont allow pedestrians 2020-07-31 10:33:59 -07:00
Dustin Carlino
71b68cc639 don't assume off-side sidewalks on dual_carriageway=yes. don't infer
parking on tiny roads. fixes some geometry in krakow. #230

(unrelated: add a debug layer to show parking blackholes, to work on
bike connections)
(also unrelated: better error message for #256)
2020-07-31 10:07:29 -07:00
Dustin Carlino
2b9123d261 fix border intersection geometry when the road is too short. closes #251
while regenerating, also pick up landuse=grass as a park area. noticed
missing in krakow.
2020-07-28 13:41:12 -07:00
Dustin Carlino
e1e265db14 tighten up Polygon constructors to enforce an outer ring... in most
cases now.
2020-07-27 14:03:55 -07:00
Dustin Carlino
fe41928cc8 explicitly allow osm highway types, instead of trying to deny stuff.
part of #231. handles construction much better.
2020-07-25 17:06:09 -07:00
Dustin Carlino
0c15b06922 detect invalid .osm with duplicate nodes/ways/relations in parser. closes #212 2020-07-25 15:00:52 -07:00
Dustin Carlino
7a00839553 ditch osm-xml, make a new osm parser from scratch based on roxmltree.
skip unreferenced objects, make the output extremely easy to consume.
also fix timers in importer. this helps with #212, although the actual
problem there is weird.

regen everything. some parking lots change a bit, but not horribly, and
that code needs some attention anyway.
2020-07-25 13:52:41 -07:00
Mateusz Konieczny
a4a545cc79
handle more OSM tags - especially POIs (#244)
also, add graveyards like cemeteries
2020-07-25 07:01:55 -07:00
Dustin Carlino
fc761ae032 stop bringing in railway=rail for seattle. it's cosmetic only, and it messes up some geometry in south seattle and causes gridlock. not worth it yet. 2020-07-24 20:22:33 -07:00
Dustin Carlino
643073b4d5 for #231, pass data between osm_reader and split in a way less horrible way 2020-07-24 19:33:35 -07:00