osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.36k stars 985 forks source link

Import Waypoints from GPX File into Navigation #20100

Open Sonwon1 opened 2 weeks ago

Sonwon1 commented 2 weeks ago

Describe the idea (required)

When importing a GPX file the import only shows the exact route. The imported file does not show waypoints between the start and end waypoints and does not provide proper turn-by-turn navigation. I propose a new GPX file import process type. When importing the file OsmAnd prompts the user for which import type the user wants:

1) Exact route without waypoints and without turn-by-turn navigation (existing today). 2) Waypoint turn-by-turn navigation route that may not be the exact route (new).

Choice one would import the GPX files the same as OsmAnd currently works.

Choice two would add the the first 'wpt' entry in the GPX file into the navigation list as if the user was building a new navigation. Then the second and third and etc. 'wpt' entry in the GPX file into the navigation list. This would continue until the last 'wpt' was added to the navigation list. At this point the waypoint import process would be complete. The user could then edit the navigation list if desired and / or save the navigation for future use. Or just start navigating the route.

This would provide all of the waypoints with turn-by-turn navigation.

Many users of OsmAnd have complained about the waypoints in OsmAnd. This would fix the user's problems with missing waypoints and the lack of proper turn-by-turn instructions.

Tell us about the expected behaviour (required)

I think above explains it all. Please let me know if there are questions.

Tell us about alternatives you've considered (required)

I have tried importing numerous GPX files of various formats to obtain proper turn-by-turn instructions and to load the waypoints without success.

Context (optional)

The current turn-by-turn instructions provided after importing a GPX file are not useful when driving on the Autobahn. For example, OsmAnd shows a right hand turn at the intersection of the Autobahn and does not prompt the user to get off the exit and does not draw the route using the exit. It is very confusing to know which way to go when there are two or more Autobahn intersections and exits to consider since there is only a right hand turn icon splashed down in the middle of the intersections. This caused me to miss my Autobahn exit causing me to drive 35 minutes out of my way to get back on route, more than once.

yuriiurshuliak commented 2 weeks ago

Could you share a specific GPX file for us to review? Also have you tried attaching the track to the road? Does it impact turn-by-turn navigation in any way?

Sonwon1 commented 2 weeks ago

Could you share a specific GPX file for us to review? Also have you tried attaching the track to the road? Does it impact turn-by-turn navigation in any way?

"attaching the track to the road" does not work for long routes, 100 - 300 kilometers. It is to slow to be useful. And to be honest I have never waited for it to complete because of how slow it is. Maybe this is fixed in the newest version? Any benchmarks for how must faster the new algorithm is? I just heard about the new algorithm yesterday.

Here is a very short GPX file route that I created to test how OsmAnd handles multiple waypoints. When you go to navigation only the beginning and end show in the navigation list, leaving out all waypoints between start and end. Maybe if the waypoints were not excluded in the navigation list and a trip recalculation could be triggered based on the navigation list would work for cleaning up the turn-by-turn instructions?

Furkot_TestRoute-_2.gpx.txt

Here is the longer trip that would not provide proper turn-by-turn instructions. Since this trip was only Autobahn most of the way only a beginning and end waypoint was needed. Most of my routes have waypoints spread through out the route for route shaping. This trip had the Autobahn misdirection which caused a wrong turn.

2024_UseHotels-_3.gpx.txt

Please let me know if you would like anything else.

0709wiwiwi commented 2 weeks ago

The Furkot export track files.

Trjaect: Furkot_Test_Route-2.gpx Redesign by Cruiser TBT navtrk. (Routing by GH online)

Traject: 2024_Use_Hotels-_3.gpx Redesign by Cruiser TBT navtrk. ( Routing by GH online)

OsmAnd imports this as regular simple "naked" track.

As the various routers generate trajects along different roads an aternavite along the A5. 2024_UseHotels-_3_wpt_navtrk.via.A5_by.Cruiser.gpx.txt

Video

Sonwon1 commented 2 weeks ago

@0709wiwiwi

Let me dig into that, maybe I did something wrong with the export?

0709wiwiwi commented 2 weeks ago

What I notice is that the track point definition in the Furkot version is much smaller and thus does not follow the roads very detailed and precise, which is what you should normally expect with a track. A road matching tool does probably not handle that very well. The OsmAnd dev's can probably tell more.

Sonwon1 commented 2 weeks ago

@0709wiwiwi

When I created that route I think it was in low resolution. I will create a new file and try to upload it into Cruiser App. Does that app work with multiple waypoints?

Sonwon1 commented 2 weeks ago

@0709wiwiwi

I give up trying to create an importable gpx file. So if the routing service I am using cannot create importable gpx files that will provide turn-by-turn instructions then what web based routing service is a user suppose to use? I don't want to create routes on a small tablet screen and https://osmand.net/map is not ready.

0709wiwiwi commented 2 weeks ago

I will create a new file and try to upload it into Cruiser App. Does that app work with multiple waypoints?

@Sonwon1

What you need is definitely possible. Import gpx waypoints or routepoints and let the router calculate you a traject inclusive the TBT instructions. Super simple easy to use and good.

Reference and examples find here:

https://github.com/osmandapp/OsmAnd/discussions/14122#discussioncomment-9720479

Cruiser app. As Android app version but also a brilliant nice desktop version is available. https://wiki.openstreetmap.org/wiki/Cruiser

BRouter web and RouteYou web (Osrm routing- Set export as Locus gpx file) also generate the simple to use 100% reliable plug and play gpx navtracks. Plus the Cruiser app additionally imports and navigates the Kurviger web (GH routing) designs by the .kurviger files.

Instantly follow an imported navigation track 100% truthfull inclusive correct TBT.

There are sure (motor)bikers in your area who will help you to get started. Sign up in the Cruiser Github discussion forum and find out more. https://github.com/devemux86/cruiser._

Exchanges between apps unfortunately remains a pain point which is quite easily to solve with a Gpx navigation track. Highly desirable as this offers very simple (no hassle) comfortable file exchanges between multiple apps.

Sonwon1 commented 2 weeks ago

Thank you for the reply! I will look into these tools to see how I can use them for planning tours!

I like the routing service I am currently using since it allows planning a trip with multiple days in one go and breaks them up into multiple days for the navigation app. It also makes suggestions where the hotel stops would fall on the route. And allows to add time to see an attraction like 15 minutes for a photo stop or several hours for seeing a cave, etc. so the day does not become overly long.

I would like to stay with OsmAnd since it has most of the features I desire. Although the other navigation software you mentioned looks interesting too.

Between the routing and navigation service I will likely have to give up some features to make this all work together with the least amount of effort.

I notice when the gpx file import fails it is usually at roundabouts, freeway exits and intersections. And I have yet to test the new attach to roads algorithm. I read here that the beta has a speed bump so maybe it is usable now?

I thought of another test, will be back shortly.

0709wiwiwi commented 2 weeks ago

Fine understood.

I see it this way. Each individual app definitely has features and tools that someone likes more or less. I don't see the range of apps as competitors either, but they can complement each other perfectly. What is mainly missing is a simple uniform file exchange method so that already added valuable elements such as TBT together with the via and shaping point info are not lost in exchanges. However, the exchange situation is currently as confusing unfortunately as it once was in Babylon.

Sonwon1 commented 2 weeks ago

I have noticed that to be true!

Sonwon1 commented 1 week ago

Since gps files are not standard and since importing them to create routes that provide turn-by-turn instructions is hit or miss, mostly miss in my experience. I believe having the option to load the route list with only entries from the gps file would be a doable workaround. It is unlikely all of the gps files are cleaned up so they work with OsmAnd.

0709wiwiwi commented 1 week ago

@Sonwon1 It would sure be optimal if OsmAnd also offered you this simple mode

vshcherb commented 1 week ago

@yuriiurshuliak please summarize with screenshots I'm not sure I caught how exactly it would be easier to deal with GPX waypoints.

yuriiurshuliak commented 1 week ago

Issue Summary:

When importing a GPX file, OsmAnd only shows the start and end waypoints, missing intermediate waypoints and proper turn-by-turn navigation.

Steps to Reproduce:

Conclusion:

When importing the tracks Furkot_TestRoute-2.gpx and 2024_Use_Hotels-_3.gpx, waypoints do not display, although turn-by-turn instructions work correctly after attaching the track to the road.

Proposed Solution:

New import option that includes all waypoints for navigation.

OsmAnd~ 4.8.0#2533m, released: 2024-06-19

Sonwon1 commented 1 week ago

@yuriiurshuliak I've been thinking about the post about and I am not sure if I was clear of what I am asking for. When I import a GPS file track or route I would like the option to select all waypoints and then OsmAnd router adds the route to follow. I don't want the route to come from the GPS file since that appears to cause turn-by-turn instruction issues in my experience.

Or if there is a way to trigger a route recalculation based on OsmAnd router for the whole route after import that would be great too.

And thank you for looking into this!

0709wiwiwi commented 1 week ago

@Sonwon1.

I tested the road matching further anyway by using OsmAnd web. Setting OsmAnd web Track road matching | Java based routing | (10m) |.

Your original Furkot track demo version: Until both roundabouts correct, then jumbled.

I removed that nasty trackglitch from the original file. Find the new file in attachment. Furkot_TestRoute-_2_cleaned.gpx.txt

Import into OsmAnd web and the TBT are correct. Conclusion: Garbage in = Garbage out.

Sonwon1 commented 1 week ago

@0709wiwiwi

I saw that error in the track I had exported and corrected the routing to fix the problem. I did not noticed it until 2 days ago and we were pass that discussion. However I do not believe the longer route I created has that problem and it did not work. It appears to me that turn-by-turn instructions are not working with an imported GPS track file when you add Autobahns with over passes. I suspect sometimes the track points are place over an underpass/overpass intersection and the turn-by-turn routing gets confused as to which road you are on under or over road which causes the turn instruction errors. Maybe that is a bug that needs to be looked at to see if I am correct in my suspicion or maybe I am completely wrong. It would explain why the route only showed a right hand turn when I should have taken an exit.

Also, I did report back to the routing service the problems you pointed out in the GPS files above. I am looking forward to OsmAnd.net/map website being fully functional.

0709wiwiwi commented 1 week ago

@Sonwon1 Roger. A track glitch is mostly caused by a sloppily placed shaping point falsely positioned onto a side road. Normal tracks do not keep any shaping point data so the cause can hardly be retraced. In a gpx navigation track this valuable info is kept, so such errors can more easily be detected and rectified. Also helpfull to detect errors is to check the turnlist for unplanned u-turns. Anyway in order to produce correct usefull quality tracks planner accuracy and discipline is most important.

Adding TBT to an already excellent quality track design requires road matching. However a road matching router result may (sligthly) differ with the original built. It remains a bit of hocus pocus and than hope for a favourable useful outcome With a gpx navigation track, road matching is unnecessary as the TBT are present. What has been put together with great care inclusive via_shaping points is not lost.

Through current track file transfers between apps, this valuable information is not attached which means that in the receiving app you thus have to redesign an already fine and correct trackpath virtually back from zero and so risk to add new anomalies. It causes unnecessary loss of time. 😢

Sonwon1 commented 1 week ago

@0709wiwiwi

I wasn't talking about shaping points positioned on a side road and in that case I would totally agree.

I am referring to track points dropped throughout the route. In the GPS file I am not seeing any formatting to define if a track point is on top of an overpass or under an overpass. So I suspect the track point is dropped on top of overpasses. So when the routing algorithm tries to create a TBT it ends up giving instructions to get off the Autobahn to route to the track point on top of the overpass and then back onto the Autobahn. Perhaps this is a failure of the software creating the GPS file? This is not my area of expertise.

I tired to duplicate my scenario however I am having difficulty with getting track points to align on top of an overpass so any occurrence is random.

If I am correct I may have two different possible solutions that could fix to the algorithm to make it ignore track points when dropped on an overpass.

0709wiwiwi commented 1 week ago

@Sonwon1. I know what you mean. I can only conclude that the road matching behaviour is too erratic and unpredictable to arrive at a robust stable usable result without worries. Testing the road matching (a difficult task anyway ) usability was my intention but it in no way meets the expectations. I am not wasting more testing time on it yet.

Your actual and original question was to use gpx waypoints to build a good reproducible TBT traject with it.
Let's talk about that. I'll prepare some more, and come back to this later. Nice weather cycle time first now.

0709wiwiwi commented 6 days ago

@Sonwon1.

Better manually (re)compile track trajects to avoid bad TBT instructions. Place shaping_via routepoints away from road intersections. When selecting existing (poi) gpx waypoints as routepoins the optimal positioning is out of control. Non optimal positioned routepoints can produce short unexpected track tails inclusive false TBT and u-turns.

Such annoyances can be solved by a tool that avoid all this. The (free) correction range to avoid this is 40m by default. An extra shaping point still allows to create short deviations in range. RouteYou web offers +/- similar by a fixed 100m correction range.

Save a calculated result in an easy to share gpx navigation track. A compatible receiver app will offer an 100% identical TBT track.

A demo using cycle node waypoints.

Sonwon1 commented 6 days ago

@0709wiwiwi

I understand that and my refined routes avoid those turn around tails. My waypoints are placed as needed for stop locations and to shape a route. I got into that habit when I used Google Maps (GM) for routing. I needed shaping points and since GM only allows waypoints I had to use waypoints to shape a route. With the new routing software it allows for shaping points so my new routes only have beginning, stop locations and end waypoints. And I correct waypoint placement errors as needed. The longer route I posted was refined however I think you said the GPS file was poorly constructed. The sooner OsmAnd.net/maps is completed the better.

I am okay with tossing out the track points and using just waypoints to build a route. I can either import them (easy but not possible atm) from a GPS file or enter them manually (painful).

Where are we going with this?

0709wiwiwi commented 6 days ago

Ah so, Google maps. Simple and up to date. Osm-based apps offer neither of both.

Example:

A. 2024_UseHotels-_3 The Google maps track version: trk. gpx GMaps2GPX-directions-cbee8897e6ea453590bb276c10a3eb98-0-1718979277376.gpx.txt By dragging (shaping) Google maps only partially produces a similar track as the B33 is blocked.

B. TestRoute-_2 The Gmaps track version: trk.gpx GMaps2GPX-directions-9140ce0003d149caa1fb2f36cb576e4e-0-1719124566349.gpx.txt

A (manual) "enhanced" Gmaps track version: navtrk.gpx GMaps2GPX-directions-9140ce0003d149caa1fb2f36cb576e4e-0-1719124566349_navtrk.gpx.txt

Import > Navigate > Go. (With the right app) Turncommands

Sonwon1 commented 6 days ago

Exactly, Google Maps is far far far from a perfect product.

0709wiwiwi commented 6 days ago

Gmaps (car) works solidly in the provided app setup. Trajectory use in external apps is not encouraged. It is not "OpenGmaps". In any case, the way they promote their product is very well thought out and sure well applied.

Sonwon1 commented 6 days ago

Check if you just want beginning to end with a few stops thrown in it is solid for that.

However this is getting way off topic and the thread is getting long.

I'll be pleased if waypoints import with the GPX file. There should also be a way to trigger a recalculate route too. Although I suppose you can do that now by faking another waypoint or route end or change one of the route restrictions like dirt roads, etc.

0709wiwiwi commented 5 days ago

Pretty much anything you ask can already be done with that "other" app. Inserting pauses at via points is also coming. Ok finish now.

Sonwon1 commented 5 days ago

Not to drag this out, however the other apps are missing important pieces of functionality. After I build a tour route I then look through the route for interesting places to stop, see and take photos. Most routing services only have a subset of POI possibilities built into them and the result is limited. I have found three maybe four routing services that have more POIs than most. This is one reason why I am using a different routing service. Building a route on a small screen is tedious. If I cannot import GPS files then I have to manually transfer waypoints into OsmAnd as map markers from the GPS coordinates of the waypoint. Then I link those together forming a route that OsmAnd then builds into a mostly flawless turn-by-turn instructions. To say the least this is time consuming. I do not get a comprehensive list of POIs from most routing services. I hope this helps you to understand better where the problem lies in my usage of OsmAnd. Okay, I am all ears now so to read.

0709wiwiwi commented 5 days ago

Find more bikers in the next forums. Ask how your colleagues handle this. https://github.com/devemux86/cruiser/discussions https://forum.kurviger.de/ To see what to expect find a single discourse. https://github.com/devemux86/cruiser/discussions/209

Sonwon1 commented 5 days ago

Thank you for the suggestions.

I've researched this at several websites with Kurviger being one of them. I was unaware of Cruiser until this thread. I also went to https://advrider.com/f/ forums for more help where most adventure riders hang out.