a-b-street / abstreet

Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit
https://a-b-street.github.io/docs/
Apache License 2.0
7.37k stars 331 forks source link

tram support is missing #141

Open matkoniecz opened 4 years ago

matkoniecz commented 4 years ago

Based on import map of a central Kraków it appears that railway=tram is completely skipped. At least in some cities of Poland trams are important part of a public transport.

See https://www.openstreetmap.org/#map=13/50.0568/19.9345 or https://www.openstreetmap.org/#map=13/52.2485/21.0096

dabreegster commented 4 years ago

I'm working on supporting light rail right now. Stops and routes are also extracted from OSM -- going to add in schedule support from GTFS later. Trams and streetcars are a bit trickier, because cars and bikes can also use the lane, sometimes with time restrictions, right?

Some code refs for light rail work:

matkoniecz commented 4 years ago

What about railway=tram? I think it can be handled as alias of light_rail. For an additional bonus complexity, there are some public transport routes on railway=rail normal railway, operating as transport within city.

https://www.openstreetmap.org/node/3327094861 https://www.openstreetmap.org/way/364880817 https://www.openstreetmap.org/node/6519017988#map=19/50.08289/19.89271 https://www.openstreetmap.org/node/3327094862 https://www.openstreetmap.org/node/206270454

Trams and streetcars are a bit trickier, because cars and bikes can also use the lane, sometimes with time restrictions, right?

Main problem with trams is that railway=tram lines are mapped separately from highway=*, even if space is shared and tram tracks are on one of lanes. AFAIK this is usually not tagged but should be possible to tag this info with some lane syntax like one at https://wiki.openstreetmap.org/wiki/Lanes#Crossing_with_a_designated_lane_for_bicycles (I just asked on tagging mailing list)

And in some cases lane is just public transport, in some it is shared with cars/bicycles.

dabreegster commented 4 years ago

The separate way is why it's trickier. Explicit lane tags on the road way would be nice, but even if a scheme exists, it's probably not widespread. I think we'll have to store the separate tram ways in RawMap, then match them to roads later, probably in the map_model/src/make/initial/ layer.

matkoniecz commented 4 years ago

In case you need some place for flustrating testing - https://www.openstreetmap.org/changeset/31091690#map=19/50.07732/19.90232

Switch from separate tracks to tracks on road, road split on island, tram loop near road...

https://wiki.openstreetmap.org/wiki/Key:embedded_rails exists but it is not too useful hint and usage is low (if it is an useful hint then I can map it in Kraków and probably double usage)

matkoniecz commented 4 years ago

tram:lanes and embedded_rails:lanes tag families https://taginfo.openstreetmap.org//search?q=tram%3Alanes https://taginfo.openstreetmap.org//search?q=embedded_rails%3Alanes has minor use, but if supported I would start adding it in my city