How to replace outdated bus stop nodes and route relations with new GTFS data using JOSM?

Hi,

For context: This transit agency I work for for recently completely redesigned their routes and stops. There is some overlap but it’s a vastly different network. Currently, the stops on OSM are only showing for certain routes and none seem complete.

I could easily delete all the old bus stops for this transit agency and just upload the new ones. However, there is some data about amenities that I assume other editors have added that could be useful to retain. I also understand that node history is an important element of OSM.

I have two layers in JOSM. One layer is a SHP file from a recent export of a GTFS file containing bus stops - I have the stop name, highway, network, and ref tags ready to go. The second layer is the old stops for this transit agency currently in OSM from an overpass turbo export.

Is there a tool/plugin to compare the two layers where the stops are, say, within 50 ft of each other and if so, delete the old node but retain the node ID and other attributes? I could probably do this in ArcGIS but I don’t know how it would translate the actions to JOSM.

I would like to also do the routes, but those are attached to ways and it seems like the process is even more manual than nodes. If anyone could point me in the right direction for removing all the old routes and connecting route lines to OSM ways, please let me know! Thanks!

2 Likes

Maybe not directly what you are looking for but the front page of PTNA shows some further links to

PTNA itself provides a comparison of GTFS routes with OSM route_masters (example Winnipeg, Manitoba, CA bus 10) and GTFS trips with OSM routes (example: same bus trip_id 8362) - provided that the GTFS data is imported into PTNA and that the bus relations exist in OSM.

None of this takes away the actual work of editing :frowning:

2 Likes

Hello jbrakomccomb and welcome to the forum.
Please tell us which country you are talking about. Local contributors are the best to help you.
Greetings
Reinhard (from germany)

1 Like

The plugin you are looking for is called conflation.

This was easy but now there is the but:

  • Bus stops in OSM are often several objects
    • There is the public_transport=platform and the public_transport=stop_position plus possibly a type=public_transport, public_transport=stop_area relation and maybe even a type=public_transport, public_transport=stop_area_group relation, see Relation:public_transport - OpenStreetMap Wiki
    • public_transport=platform can be a single node, a closed way or a multipolygon relation.
    • Depending on the details of the GTFS data even multiple stops like stops on both sides of the road or multiple stops at a major transit stop might only be present as one item in the GTFS data.
  • The position in the GTFS data is often less accurate than the position in OSM.
  • name=* should follow the on-the-ground rule, e.g. the name on the stop sign. If unsure better use gtfs:stop_name=*

Make sure that you get all relevant objects with your query, like the relations mentioned above, and be warned that you will work with incomplete data and that you might need to download all referrers in advance of several actions like moving or deleting objects.

I would first focus on the stops as the routes are a totally different story.

1 Like

This is related to a suburb of New York.

Thanks!

I tried downloading the conflation plugin but it seems to fail to install, unlike a few others I tried downloading. I wonder if the link is currently down? I will try manually installing it.

For our case, I know that the GTFS stops are on the ground location data, so I’m not worried about that as much but the stops themselves only have the endpoints named, so I will switch the tag to what you suggested. The names are the closest intersections or major POIs.

I just tried it with fresh (empty) preferences:

java -Djosm.home=/tmp/JOSM -jar /usr/share/josm-latest/josm-latest.jar

and installation of the plugin(s) worked smoothly.

I totally forgot to ask about the license of the GTFS data. I hope it is compatible with the ODbL, see Licence/Licence Compatibility - OpenStreetMap Foundation. Additionally, please, take a look at Import/Guidelines - OpenStreetMap Wiki.

I don’t know that we have a license for the static feed, as it’s self maintained but I can certainly check and, if needed, have it stated on our GTFS page. Thanks for the heads up.

I opened JOSM today and the conflation plugin was there on the sidebar… not sure what happened! So after using the tool for a bit it seems like my next steps are to keep the “reference only” new stops, conflate the stops where the stops where there are matches keeping the reference new tags and location but using the subject OSM history and additional tags (as available), and mark the “subject only” for deletion since those are in areas no longer served.

For the export of old/existing bus stop points, I used the below from Overpass. Then I filtered it by operator to purge other systems.

[out:json][timeout:25];
(
nwr"highway"=“bus_stop”;
nwr"public_transport"=“platform”;
nwr"public_transport"=“stop_position”;
nwr"public_transport"=“stop_area”;
nwr"type"=“public_transport”;
nwr"public_transport"=“stop_area_group”;
);
out geom;

Thanks for the help! I will follow up if I have issues.

The license is the most important part to be checked and it should be stated on the GTFS page. By the way, would you mind sharing a link to this page? If the license is compatible the GTFS data could be included in PTNA.

Your overpass query could definitely be optimized as e.g. stop_area and stop_area_group are only valid for relations and stop_position is only valid as node, but I am far from being an expert regarding overpass. So you might want to start a new thread about it in order to get answers from the experts.