Open jidanni opened 1 week ago
I don't think it makes a whole lot of sense to reimplement the GPX export for 3 different routing engines. However, it might be a better idea to add some links underneath the direction results which point to the respective engine demo pages.
These pages anyway have much more capabilities, like supporting additional waypoints. And more importantly, they also come with either GPX or GeoJSON export out of the box.
Example links:
https://graphhopper.com/maps/?point=24.18978%2C120.86377_24.18978%2C+120.86377&point=24.18252%2C120.86482_24.18252%2C+120.86482&profile=hike&layer=Omniscale
or a bit simplified https://graphhopper.com/maps/?point=24.18978%2C120.86377&point=24.18252%2C120.86482&profile=hike
https://valhalla.openstreetmap.de/directions?profile=pedestrian&wps=120.8635823%2C24.1893169%2C120.8648163%2C24.1825192
https://routing.openstreetmap.de/?z=17¢er=24.188205%2C120.858920&loc=24.189317%2C120.863582&loc=24.182519%2C120.864816&hl=en&alt=0&srv=2
or simplified as https://routing.openstreetmap.de/?loc=24.189317%2C120.863582&loc=24.182519%2C120.864816&srv=2
Is there a valid editing use case for this? It sounds like an end-user feature request to me?
It's the difference between being a closed source and open source website. @mmd-osm's suggestion would allow the OSM website to keep fully open. Yes, it's not exactly source code in this case, but source data. Same thing.
Is there a valid editing use case for this?
For links to routing engines I guess it's the same as with Nominatim, which we have. Hopefully they provide more information about why the route was build this way.
For exporting from the osm website, you can use the trace as a guide for downloading areas in Josm for example. I'm doing something similar with notes my note viewer to generate a "path" of consecutive notes.
I have updated the example URLs from above to only require start lat/lon and end lat/lon values as well as a profile.
https://valhalla.openstreetmap.de/directions?profile=pedestrian&wps=120.8635823%2C24.1893169%2C120.8648163%2C24.1825192
https://routing.openstreetmap.de/?loc=24.189317%2C120.863582&loc=24.182519%2C120.864816&srv=2
https://graphhopper.com/maps/?point=24.18978%2C120.86377&point=24.18252%2C120.86482&profile=foot
For the profile values, I'd suggest the following mapping table:
Car | Bicycle | Foot | |
---|---|---|---|
Valhalla | car | bicycle | pedestrian |
OSRM | 0 | 1 | 2 |
GraphHopper | car | bike | foot |
OSRM (FOSSGIS) is a bit special, since the values appear to be derived from the sequence in https://github.com/fossgis-routing-server/cbf-routing-profiles/blob/master/profiles.conf.example#L2 ... the profile values are valid for the FOSSGIS instance only.
I think that's probably all we need to generate URLs similar to Nominatim.
Problem
Directions tracks are great,
But the website needs to provide a free and open export method, like
else the direction tracks are merely one more proprietary solution, requiring the user to reverse-engineer the internal communications with the browser, if the user wishes to export the path:
Internal communication interception (via DevTools):
So the user must employ a polyline decoder, or SVG analyzer... https://stackoverflow.com/questions/32476218/how-to-decode-encoded-polylines-from-osrm-and-plotting-route-geometry
Well all I got were sections of the equator. So I'll just give up trying to reverse engineer it.
Probably end up using Google, https://gis.stackexchange.com/questions/152571/export-google-maps-route-to-kml-gpx