pure-maps
pure-maps copied to clipboard
Public transport
It would be nice to have public transport routing in Pure Maps. Possibly https://github.com/GNOME/gnome-maps/tree/main/src/transitplugins could be used? This is supposedly what's used in GNOME Maps, which supports public transport routing in Switzerland using transport.opendata.ch (and surely more through other sources)
Some other notable software:
- KTrip
- Reisplanner SFOS
- Farhplan SFOS
From OSM wiki (https://wiki.openstreetmap.org/wiki/Public_transport/Tools):
osm2gtfs - source is a script to turn OpenStreetMap data and schedule information into GTFS, which can be widely used, like in OpenTripPlanner or in the mobile application Transportr.
So there's tools to gather public transport information from OSM and used as a layer of some sort?
That Transportr looks pretty cool, and it's available on F-Droid: https://transportr.app/
I'd suggest to look into Valhalla, router used by OSM Scout Server and Stadia. Before it was possible to import whole dataset, but later I had issues with downloading it. So, someone has to figure out how we can add that to Valhalla. Internally, it should support public transport.
One of our students, @lhaenschke, is currently integrating public transport support using KPublicTransport (the library used by KTrip) into his version of PureMaps, it's still WIP, but it can already be used to search for connections from nearby train stations (bus stations will be handled in the future), see https://github.com/rinigus/pure-maps/compare/master...lhaenschke:pure-maps:master if you are interested.
@rinigus Do you think such an approach could be integrated after some polishing?
I am very happy that someone is working on Pure Maps - haven't had time for a while to do it.
I have looked into KPublicTransport integratrion as well and was thinking on how to do that. From the quick look into your code, some feedback:
- indeed, KPublicTransport is C++ lib, so we will need some kind of C++ API provided to the rest of Pure Maps. In this respect,
org.puremaps.TrainConnection
is a correct approach - KPublicTransport is more generic than train connections router. We should find more generic name for it and not use "Train" in the classes/vars.
- In principle, it is a router. So, all code should comply with router API. It is a complicated one, as many parameters can be given and alternatives are possible. But it is possible to handle via router API as well. For start, let's set that you cannot automatically reroute and only manual rerouting is supported. If there is a flag missing for it, we would have to add that back
- When I state that "all code" should go under router, we would have to think about C++ bits. maybe those should stay in the main tree for simplicity.
I think it is mainly code moving and thinking it through on complying with router API. Maybe it is already, but I just didn't notice it.
Hopefully this helps