Automated incremental Bus Stop (GTFS) updates

I’m investigating ways to increase the “bus factor”. Currently, when fetching new MOT GTFS files, the script needs to compare them with the files fetched the previous run. This means that if I lose both my PC and my PC backup, or if I ever get hit by a bus, running the script properly would be a bit fiddly, because one would have to reconstruct the lost file.

I would like to make the script completely stateless locally. This should be technically possible: Fetch latest bus stop changeset by SafwatHalaby_bot, and use that as the “old gtfs file”. This would make the script solely dependent on OSM servers, and not on any local hard drive.

This might be a major overwrite, so while we’re at it, I would like to rewrite the script such that it does not depend on JOSM. This should make running it headless natural and pave the way for complete automation.

Replying to an old point:

According to https://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dplatform , ref= should be used for that. I’m not sure whether that tag is supposed to go on the highway=bus_stop node or on something else.

Glad to hear of the planned bus factor improvements.

There is a semantics issue here. The thing called “platform” in the Wiki is essentially a bus stop, we already use the “ref” tag for bus stop numbers.

The thing called a “ratzeef/platform” in the MOT GTFS is better translated into a “terminal number”, available only for some bus stops, mainly in central bus stations. So far I couldn’t find a Wiki entry which discusses it.

I don’t think you can call it “terminal number”, the רציף/platform in the GTFS is a platform just like a train station platform.

A bus terminal is what we call מסוף אוטובוסים in Hebrew. The Tel Aviv Central Bus Station or Arlosoroff Terminal are bus terminals. They don’t have numbers.

The “platform” in the GTFS file is there so that transit navigation apps will point users to the right platform for their bus. The GTFS file does not have the accurate coordinates for each platforms, so it uses the same coordinates for all and the same name for all, for example “Tel Aviv Central Bus Station 7th Floor/Platforms” ( https://www.openstreetmap.org/node/1803094757 ) is one node in OSM and one stop_code in the GTFS, but it has many lines in stops.txt with different stop_id for each, and the difference is just the stop_id and the platform number.

Considering this, I don’t see how keeping the “platform number” is useful to OSM in any way, and I suggest you ignore this in your automated imports, and only have one OSM node per GTFS stop_code.

Agreed. The “platform number” is currently ignored.


The deletion of stops is slowly making the OSM dataset deviate from the MOT dataset. I propose preventing users from deleting stops. Non existing stops would have to be reported upstream to MOT, just like renaming. Comments?

As a reminder, here are the current conflict handling rules: https://wiki.openstreetmap.org/wiki/User:SafwatHalaby/scripts/gtfs#Information_for_mappers

I am essentially proposing replacing “You may delete a bus stop” with “you may not delete a bus stop directly. Contact MOT instead”.

I just completed a bus stop update in #64848970.

This is a normal update, except that it’s bigger than usual, because the last update was 4 months ago.

Click here to see the full history, or here for more info regarding bus stop updates.

“Contact MOT” is not enough - the exact web address/email should be added, otherwise this will be useless…

@SafwatHalaby Great job You do! Thank you :slight_smile:
I believe the last changes are good improvements, relaying on MOT/GFTS data is more clever, although it has its own mistakes.

What about adding the bus numbers (Mispar Ha Kav) as a new tag to each bus stop?

It will give useful information for passengers and trip planners
The data is available as route_short_name in routes.txt in GFTS database.

@Reuven Bus numbers shouldn’t be mapped as new tags on the bus stops but as new relations of which the bus stops are members; see the schema: https://wiki.openstreetmap.org/wiki/Buses#Bus_routes

Your suggestion makes sense; in fact, I made a similar suggestion in this very thread some time ago; see discussion starting at https://forum.openstreetmap.org/viewtopic.php?pid=682596#p682596

To summarize the main objection raised by some of the mappers:

  • The MOT route data cannot be relied upon, so an import would include the stops a bus goes through, but not the exact route or the street names.

  • The route=bus relation mandates routes, so an import must invent a new relation and not use route=bus.

  • The import needlessly bloats the map and complicates the import/conflict resolution code without adding much practical value to OSM, “because importing the bus stop data without the roads and routes / because importing the data in any form” isn’t of much use to OSM.

Of course! The exact address can already be found at the page, and if the deletion change is ever added it would also link to the address.

https://forum.openstreetmap.org/viewtopic.php?pid=704210#p704210

Pinging this old issue. Suggestions appreciated.

Hi SafwatHalaby, are you going to run your great bot? I really miss bus-stop updates last couple of months…

Hello! Sorry for the infrequent updates. I had been unable to perform the runs weekly in the past few months, but starting next week the regular updates should return.

With that said, I would like to re-write the code ASAP. (It will likely be re-written in Java). The re-write should make it cleaner, allow full automation, and make it locally stateless. I aim for minimal dependencies (preferably only the standard Java library) so that it can run for a very long time without maintenance.

Script has been executed.

Changesets:
https://www.openstreetmap.org/changeset/91500256
https://www.openstreetmap.org/changeset/91502029

Thanks!

Possibly unrelated but how do I get osm(and) to show transit routes in directions?

I get "Unfortunately, OsmAnd could not find a route suitable for your settings

Try changing the settings."

Is importing the GTFS data from MOT abandoned? Is the data still too bad to be used? Can I help as a developer?

1 Like

hello @SafwatHalaby and everybody else.
first, i’d like to thank for putting out country on the map, in the spirit of Tal.
since the use of the bus stops is the busses that would stop there,
would it be possible to go further and load the bus routes (with the meaning in osm),
from the same gtfs repository?

with best regards,
alex

the bus stations are in osm, but the buse routes( ~lines) not yet.

It looks like the periodic import of bus stops update in Israel is no longer performed.
As far as I can see, the last update import was in Changeset: 93373309 | OpenStreetMap, dated 2020-11-01.