I built a small open-source GPX route planner based on Leaflet, BRouter, and Nominatim.
It is implemented in JavaScript as a single HTML file and runs entirely in the browser. It exports GPX files usable in GPS devices or mobile navigation apps (such as OsmAnd, Locus, etc.)
You can try it at: GPX Route Planner
And the source code is available at: GitHub - patricklmarie/GPX-Route-Planner: Small route planning application designed to enable hikers, cyclists, or motorists to plan their trips by plotting a route on a map. Also a GPX editor: routes can be exported as GPX files and then used with GPS devices or mobile navigation apps. The application is written in JavaScript, contained in a single HTML file, and makes use of OSM tools.
I would be interested in any feedback.
Nice tool, easy to work with.
Two things which will keep me from using it for my hikes:
- I can’t draw a straight line, it always routes. Practically all my hike routes require me to draw my own line in several places, without the routing. My current tool has a “draw straight line” mode.
- It does not show OSM hiking/foot route relations. My current tool can use waymarkedtrails/hiking as a background map.
When loading an existing gpx, it would be nice to have the map pan/zoom to the area, or have a button to show/center the route.
Editing a route works easy and intuitive.
What I miss most in my current tool is 1. cutting a route (and save as separate gpx files) and 2. load and combine two gpx’s then save as one gpx. Combining may require the user to indicate which end points to connect, and possibly reversing one.
Thank you for testing the tool!
- It is actually possible to plot straight lines: you must select “–none–” in the “Travel mode” dropdown list.
- Could you please provide me with more details about the map (with hiking/foot routes) which you would like to use? If it is an OSM map that I can easily add, I shall do it.
Pan/zoom to area: nice idea, I will add it!
- Cutting a route: My tool cannot do it for now. Let me think about it.
- Merge several GPX files: My tool can do it, since importing a GPX file does not erase the stages which are already defined in the tool. Therefore, importing two GPX files, then exporting the result, will do the merge.
An apt name for that would be “Crow”. ![]()
Implemented.
![]()
“none” sounded to me like it wouldn’t do anything at all!
I use a tool that has a layer which shows waymarkedtrails hiking map. I’m not technical enough to know how easy it is, just that it’s possible. There is technical information under the question mark button.
Tried this: looks like the stages are exported as separate tracks (trk) in one .gpx file. The function I need is that the tracks are joined to form one track. To do that, the tool needs to determine which ends to join, and the order and direction of the tracks. Probably it would often suffice to just find the two closest endpoints, then possibly reverse one of the stages to match directions, then add the trackpoints of the second to the first and keep only the result. Or, let the user drag the endpoint of one stage to the startpoint of the next.
A “reverse” function would be handy anyway, I think. I use that a lot, because I often combine routes from different sources, and I often hike stages in reverse direction.
Done. Thanks!
I just added two map styles looking like those of WayMarked Trails (one for hiking and another for cycling). Could you please take a look at: Leaflet Provider Demo and check whether there are other map styles worth adding?
Yes, that’s how my tool works: importing a GPX just adds other stages to those already there. It does not merge stages. Merging stages would technically be feasible; the tricky thing would be how to select the stages to be merged, how to specify the merge order, how to specify their direction when merging (some may need to be reversed) and how to specify how to join them.
Simply reversing a stage would be easy, but not always satisfactory. While it would be acceptable for hiking routes, it could be dangerous for cycling and motor routes: these may include one-way streets/roads and plain reversing would lead to using them in the wrong direction. Therefore, when reversing, the stage path needs to be recalculated.
Let me think about it…
I know, because my usual tool offers it but doesn’t allow to specify the order, the direction and what the merge points are. In the end, most of the time long straight lines connect seemingly random endpoints. That’s why I suggested (for 2 stages) to join the two endpoints closest together, and reverse one of the two tracks if needed. I sometimes do that outside the route tools, by editing the gpx or gpx’es in a simple text editor.
The other method is to let the user set the directions, then simply add the second track (stage) to first track (stage), without rerouting.
You are right, reversing sometimes requires rerouting. In OSM relations, the exact routes of both directions are specified, but the track in your tool doesn’t know that! For hiking, it wouldn’t matter much, but for cycling most routes would have sections where the directions differ.
I implemented the “reverse stage direction” functionality.
I like your application and use it to display my own GPX when I have to check something in regard of a trip some month ago. Very helpful that it is possible to open more than just 1 GPX at once. I just noted a very minor error in the disply, reporting the distance in km instead of m:
Anyhow, well done, thanks!
23.944 is 23 and decimals, isn’t it?
Oh yes, as this is an english version you are definitely right. As my track is originated in Germany and I used another german based display until now I was automatically expecting the german version where the dot is just the thousand separator
.
That is correct.
Thank you for trying my application!
You can already import several GPX into the tool, but they become parts of a single route. I guess this is not what you expect and are talking about… Adding support for multiple independent routes in the tool would require quite a bit of work and it is not something I plan to implement for now. .
Not necessary for what I am using it, it’s fine as it is.
I added some new functionalities:
- Reverse the direction of a stage.
- Split a stage (into two stages).
- Merge a stage with another.
- Auto-fill the name of a stage.
You can try them at: GPX Route Planner
Had a quick look. Let me first say, I’m very happy with these functions, even if my remarks are all things I think could be improved!
- Auto-fill: my use is mainly walking. I regularly end in the same city/village I started in, just at a different spot 15 Km away! For walking, city(start) to city(end) just isn’t precise enough. I wouldn’t know a better solution for auto-naming though.
- Split stage: works fine. I had to get used to the scissors cursor disappearing just where I want to cut! Maybe the arrow could become a smaller scissor when indicating the spot on the stage?
- Reverse: Maybe it’s just me but I find the green and red circles not that clear, especially when multiple convoluted stages are in view. Maybe the start icon could be, say, a triangle arrow showing the direction?
- Join stages: Happy with the function, but I couldn’t figure out how exactly it works, i.e. which end of which stage gets attached to another one, and whether or not I should reverse a stage first. I guess the end of the active (edited) stage is joined to one end of the stage the user indicates, but I could not see that before the join, and I could not undo the join to try again! (Also, the crow setting kept disappearing so the join would route when I wanted to do a straight line join.)
So, I desperately wanted an undo/stepback function (Control-Z), and maybe something can be done with a dotted line showing which ends would be joined?
