google / transit

https://gtfs.org/
Apache License 2.0
617 stars 183 forks source link

Specify features such as tunnel in shapes.txt #520

Open miklcct opened 2 days ago

miklcct commented 2 days ago

Describe the problem

I would like the ability to specify if a trip goes through a tunnel.

Use cases

I want to add a preference in the journey planner for the user to avoid tunnels, and show these tunnels on the journey plan.

Proposed solution

A new field in the shapes.txt to specify features en-route, such as tunnels.

Additional information

No response

skinkie commented 2 days ago

Since shapes.txt does consists of nodes, instead of links, addressing a section is something that should first be cleared up. Dependend on what the target is for example cartography, allowing the rendering of tunnels, roads, bridges, or just the ability to tell if the next section passes through a tunnel, it might be more relevant to specify it in stop_times.txt instead.

miklcct commented 2 days ago

stop_times.txt is not an appropriate place to store bridges and tunnels because it is a property of the track, not a property of a trip nor a property of a section between two stops.

Tunnels and bridges are geographical properties, where shapes.txt tries to plot them on the map. If we can get this feature in, we can also plot bridges and tunnels on the map shown to the user as well.

skinkie commented 2 days ago

@miklcct it certainly is in the way you described it. You described the feature as a filter. A similar filter exists for trips.txt to bring a bike aboard a vehicle. When you state I want to do a geographical description, and from that description a filter can be derived, that is a complex action, because that would required the journey planner to align shapes.txt to stop_times.txt, figure out what section a user may want to avoid.

Like I wrote before, you are suggesting to mix carthography with filters. And did not mention this in your Use cases.

miklcct commented 2 days ago

For example, the section between two stops is 15 km with 5 km in tunnels, so I want the journey planner to apply a penalty on one third of the running time for that section.

doconnoronca commented 2 days ago

I was just thinking a something to describe the ROW in shapes.txt would be useful to identify where a route is in mixed traffic and predictions could take current traffic congestion into account for those sections.

skinkie commented 2 days ago

For example, the section between two stops is 15 km with 5 km in tunnels, so I want the journey planner to apply a penalty on one third of the running time for that section.

But would that matter for someone that is afraid of tunnels? Wouldn't that just be a binary: no tunnels?

miklcct commented 2 days ago

Sorry it isn't a binary. For someone who's afraid of tunnels, 30 seconds in a tunnel v.s. 5 minutes in a tunnel is a huge difference.

stevenmwhite commented 2 days ago

Is the idea here that there'd be a new column on the shapes file with an enum to indicate the type of that segment, running until the next specified type on a later point?