Hi all,
Mapping a bus line in PTv2 by hand takes hours. You trace the route way by way, split ways at the right places, place every stop_position, find every platform, then do it all again for the other direction and for each variant. And a year later the network has changed.
I wrote TissWay to automate all of that. It’s a free tool (MIT) that works with any GTFS feed:
Highlights
- A whole network in one command.
tissway routes -n Twistogenerates every line of a network: one route relation per variant and one route_master per line, following PTv2. The result is a single .osm file, ready to open in JOSM. - Updates what exists instead of duplicating it. A line already in OSM keeps its relations, their ids, their history and the tags the tool doesn’t manage (operator, wikidata, note…). Only the members and the GTFS-derived tags are refreshed. Nothing is deleted, and other mappers’ work is preserved.
- Routes that actually follow the road. The path is map-matched on OSM with Valhalla from shapes.txt. When the shape is missing or wrong (straight lines, offset), the tool detects it and routes through the stops instead.
- Stops placed the way a mapper would place them. Each platform is picked on the correct side of the road for the direction of travel. The tool reuses the platforms and stop_positions already in OSM, and it fixes a common GTFS error: a stop attached to the platform across the road. Tags of other networks are never overwritten; they go to network:2, ref:2…
- Clean way splitting. Streets used halfway, termini in the middle of a way and roundabouts are split where lines enter and leave them. Every affected relation gets the right parts, including other lines and cycle routes. The longest part keeps the id and history.
- Copes with imperfect GTFS. It works with or without shapes.txt, agency.txt, direction_id, stop_code or parent_station, with basic or extended route types, in right-hand or left-hand traffic.
- Configurable per network. A TOML profile describes the feed: paths, Geofabrik extracts to download, network tags, naming conventions, thresholds. The repository ships the profile of Atoumod, the regional GTFS of Normandy, France (Nomad, Twisto, Astuce…).
- Tooling around it. Other commands complete existing platforms with gtfs:stop_id, add “via” to relations that share a name, and generate or update the PTNA route list of a network.
- Tested. 89 tests cover the tricky cases met in the field, and every error found during review becomes a new test.
Nomad line 122 (Caen ↔ Le Havre), 2 relations of over 300 members each, generated by TissWay and opened in JOSM.
Not a bot
Nothing is uploaded automatically. Every file is meant to be opened in JOSM with PT Assistant, reviewed, fixed where needed, and uploaded by you. The log lists exactly what to check: gaps between ways, platforms left across the road, stop_positions far from their stop, obsolete variants… Hours of manual mapping become a focused review. Before importing anything, check that the GTFS license allows it, and follow the import guidelines and the automated edits code of conduct.
Trying it
You need Python ≥ 3.11, osmium-tool and Docker (for Valhalla):
pip install -e .
tissway routes -n Twisto 1 2
The README explains how it works and which tags are written.
Feedback welcome
- tests on other GTFS feeds, anywhere in the world;
- cases where the result isn’t right, with an example if possible;
- opinions on tagging and naming choices (name format, no operator tag, gtfs:*: suffixes…).
Issues and pull requests are welcome on GitHub, and I’ll answer here too.
Thanks!
