osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.65k stars 1.02k forks source link

Allow importing Routes as easy as importing Tracks #18209

Open pramach opened 1 year ago

pramach commented 1 year ago

Describe the idea (required)

When you want to follow a track you created outside the OsmAnd App, you can just do Menu -> Tracks -> ... -> Import -> select the file. Done! You have imported the track and can use it.

When you want to follow a route as a combination of waypoints created outside the OsmAnd App, well then it's like feeling as an unloved child: Menu -> Tracks -> ... -> Import -> select the file -> Menu -> Markers -> Add the Track as Markers -> More (Icon) -> Dropdown Menu "Plan a Route" -> and then manually rebuild the route because the sequence of appearance does not follow the predefined route.

Target is to have the possibility to import a route as easy as a Track.

Tell us about the expected behaviour (required)

1) The menu item "Tracks" is renamed to "Tracks & Routes"

2) In the screen open, there are currently 2 groups: FAVORITES, TRACKS. This should be enhanced with a third element: ROUTES

3) Within ROUTES element, I can import GPX files with routes as routes.

4) In case an imported GPX file contains multiple routes (e.g. day 1 route, day 2 route, day 3 route, etc), by click on the file a subpage open which lists all routes inside the file (same as happen today in TRACKS).

5) When clicking on a route (within an imported file), the map screen open with the navigation pane, containing all the waypoints defined inside the route in same order (sequence) as in the route.

6) With click on Start, the route is calculated as when you build a route manually inside OsMand

Tell us about alternatives you've considered (required)

Use the way declared as solution in https://github.com/osmandapp/OsmAnd/issues/18061

Context (optional)

Planing a route (not a track) and share it with friends before the ride is frustrating due to the huge manually work to be done in OsmAnd and somehow impossible as each inside the shared group has to do the manual rebuild of the waypoint sequence again and again.

It can be asked, why not share a track instead of a route? Well, while Tracks make sense in off-road riding, driving onroad with abbreviations, detours, traffic jams and road works I regularly failed. I'm here, the track is somewhere and the map shown to small to have both visualized. With routes, when leaving a route I get an automatic recalculation of the route which brings me back towards next planned waypoint.

I'm aware that OsMand has been build mainly for OffRoad riding, that's why there are hundreds of YT Videos explaining how to use OsmAnd on Off-road. But there are mainly none YT Video about how to use OsmAnd on a planed onroad Route (not Tracks).

OsmAnd has already nearly all necessary elements implemented, but currently focussed on Tracks. With an easy implementation of route handling as described, it will bring lots of benefits for OsmAnd users driving onroad following routes.

DmitryAlexei commented 1 year ago

In the app, there is an option to share routes as links or GPX files https://osmand.net/docs/user/navigation/setup/route-details#share--export-actions

DmitryAlexei commented 1 year ago

You can also plan your route on the map (see https://osmand.net/map) and use link from address bar later for navigation inside OsmAnd app.

pramach commented 1 year ago

You can also plan your route on the map (see https://osmand.net/map) and use link from address bar later for navigation inside OsmAnd app.

Well yes, this may work but, .. Currently I plan a route based on my POI collection. I mean that's why POI collections are for, or ? Organized in countries, types, etc. As each user think it is best for him.

In OsmAnd Map, there is no POI collection management, or ? At least I have not found a possibility to upload my custom POI's.

So what can I do? Plan a route in my route planer app, then import into OsmAnd Map, save it there as a TRACK in the cloud (or download just as a collection of waypoints), then go into my Android OsmAnd App, and import a TRACK. But I need a ROUTE, not a TRACK.

Therefore, using the OsmAnd Map does not help in this request. Sorry.

pramach commented 1 year ago

In the app, there is an option to share routes as links or GPX files https://osmand.net/docs/user/navigation/setup/route-details#share--export-actions

Good Point, so I try.

Source device: my Android tablet with installed OsmAnd+ App installed Target device: my IOS iPhone with OsmAnd (no +)

I created a route, link, shared as file. This created a route.gpx.bin. This file has been copied towards my iPhone, where I see it. But can't open it in my IOS OsmAnd. Test failed.

Now I shared the file as a link. Which of course does not work with Android Nearby devices, as the nearby device is IOS. So I copied the link, wrote it into a file and send it to my iPhone. Here I can open the link in OsmAnd App. It informs me that I have first to download a map, which I do. Fine. After download of the map, no route. So I click the link again, nothing happen. Test failed too.

Anyhow, notes from your link:

So again: TRACK, TRACK, TRACK.

As written above: ROUTES (with Turn by Turn navigation) is an unloved child in OsmAnd, however I like to be proven wrong on this thought.

pramach commented 1 year ago

Please don't get me wrong. OsmAnd has most probably created by great developers as a tool to have off-road navigation, where Turn-By-Turn navigation does not make any sense. Turn left after fifth tree and then right after the first deer ..... Nonsense.

Time changes! On the time being, many people gets frustrated about the bug policy of Garmin and TomTom and thinking about exchanging their devices by mobile phones and tablets. OsmAnd is a great tool and could fit for lots of people, I really believe. But for various riders, the current usage of Turn-By-Turn navigation is just frustrating.

mikehgentry commented 1 year ago

I'm not entirely clear what the issue with using a track to generate a route is?

If you import a track, make it visible in 'configure map', then hit the navigation button, the track will be listed. Hitting it should follow it, and choosing 'attach to the roads' should give you pretty standard voice instructions. Route recalculations should work as normal. You can optionally make the track invisible again to reduce screen clutter.

pramach commented 1 year ago

So far all instructions I followed how to handle routes in OsmAnd leads to Tracks which wasn't automatically recalculated and did not gave me any voice instructions.

So I will try it out tomorrow.

Anyhow, where is the issue to handle routes natively within OsmAnd ?

mikehgentry commented 1 year ago

As I understand it a track is essentially a GPX, which is the standard format for sharing serial location data between programs.

https://osmand.net/docs/user/map/tracks-on-map/

I'm not sure that being able to share routes directly gets you a lot, since you should be able to save a route as a track, or conversely get OsmAnd to route you down a track. I've happily swapped GPX files around between people, downloaded them from the web and routed down them. Which doesn't mean the interface for doing these things can't be streamlined, of course.

DmitryAlexei commented 1 year ago

@mikehgentry You can manage your favorites in the OsmAnd Web with Cloud Start account (see https://osmand.net/blog/start) Links can be easily shared with your own devices using the saved messages folder of your messenger program (you need to have the same account on both devices).

pramach commented 1 year ago

As I understand it a track is essentially a GPX, which is the standard format for sharing serial location data between programs.

Absolut, same understanding. The GPX can be used to transport WAYPOINTS, TRACKS and ROUTES.

OsmAnd already support the load of WAYPOINTS and TRACKS. And what I requests is nothing else than also a proper & easy load of ROUTES as defined in GPX format.

pramach commented 1 year ago

If you import a track, make it visible in 'configure map', then hit the navigation button, the track will be listed. Hitting it should follow it, and choosing 'attach to the roads' should give you pretty standard voice instructions. Route recalculations should work as normal. You can optionally make the track invisible again to reduce screen clutter.

Well, what do I do when I receive not a TRACK but a ROUTE in my GPX file ?

Anyhow, I did as you described. I imported a track of 350 km In Navigation panel, I choose the track I press the button "attach to roads" I have then to press a button "Continue" A new panel pops up allowing me to define a max distance (set to 50m). Also a list of my profiles appear, which contains only Motorbikes, because that's the only profile I need. And there is a button Cancel and a button "Anwenden" which is greyed out. But whoa, after 2 minutes it gets activated and I can trigger it.

I currently could not drive so I could not test under real life circumstances. But hey, that's neither smooth nor easy.

pramach commented 1 year ago

@mikehgentry You can manage your favorites in the OsmAnd Web with Cloud Start account (see https://osmand.net/blog/start) Links can be easily shared with your own devices using the saved messages folder of your messenger program (you need to have the same account on both devices).

Sorry but it seems I'm too stupid I have several thousand POIs I've downloaded from various sources, organized per country and type. Some I need for business, some others just for fun while riding and some others for memorizing good locations I was or heard about. How can I load them in the OsmAnd Map as favorites ?

And, how to build a route with 20 or more waypoints ? Currently I just have Start and End, showing Geo coordinates.

I will try to search some YT Videos which may enlighten me.

Till, I stay on Garmin Bascamp as Routeplaner. Bit slow but works for this kind of job perfectly.

mikehgentry commented 1 year ago

As far as I'm aware GPX is completely agnostic about whether something is a track or a route (except in so far as a track will usually contain timestamps). If you load a 'route' GPX, it'll be loaded as a track. You can then route down it.

But a 350km track is going to take forever (or maybe even run out of memory) attaching to the roads. If you have problems you may need to break it into chunks.

pramach commented 1 year ago

@mikehgentry According to my experiences with GPX in the past and in line with https://en.wikipedia.org/wiki/GPS_Exchange_Format, there is a clearly difference between tracks and routes:

Conceptually, tracks are a record of where a person has been and routes are suggestions about where they might go in the future. For example, each point in a track may have a timestamp (because someone recorded where and when they were there), but the points in a route are unlikely to have timestamps (other than estimated trip duration) because route is a suggestion which might never have been traveled.

As an example, a route I have created in Garmin Bascamp. When there are 3 dots ... I snipped out some repetitive elements. <?xml version="1.0"?> <gpx xmlns="http://www.topografix.com/GPX/1/1" ...> <metadata> <link href="http://www.garmin.com"> <text>Garmin International</text> </link> <time>2023-09-30T07:44:51Z</time> <bounds maxlat="47.601227760314941" maxlon="7.607753276824951" minlat="47.036054134368896" minlon="6.727280616760254"/> </metadata> <wpt lat="47.599587757140398" lon="7.598219364881516"> <time>2023-09-28T05:59:14Z</time> <name>ATU Weil am Rhein</name> ... </wpt> <wpt lat="47.078242683783174" lon="6.851319037377834"> ... </wpt> <rte> <name>Tour 20231001</name> <rtept lat="47.599587757140398" lon="7.598219364881516"> <extensions> <trp:ViaPoint> <trp:DepartureTime>2023-10-01T07:00:11Z</trp:DepartureTime> <trp:CalculationMode>FasterTime</trp:CalculationMode> <trp:ElevationMode>Standard</trp:ElevationMode> </trp:ViaPoint> <gpxx:RoutePointExtension> <gpxx:Subclass>000000000000FFFFFFFFFFFFFFFFFFFFFFFF</gpxx:Subclass> <gpxx:rpt lat="47.599570071324706" lon="7.598178209736943"> ... </gpxx:RoutePointExtension> </extensions> </rtept> </rte> </gpx>

But as you may notice, there are WPT's and RTE's. For tracks, there are TRP's outside the RTE's but here there are none outside.

walterjwhite commented 11 months ago

If I read this correctly, the issue is that OSMAnd fails to provide the same navigation experience with an imported GPX track / route versus creating the same route within the app.

If I correctly understood, then I too have the that problem and am facing a constant barrage of voice instructions anytime the route changes direction regardless of whether I'm on the same road or not. I have snap to roads checked. I would like to use OSMAnd for more off-road adventures with GPX tracks created externally, but my concern is that I cannot use those reliably.

If I misunderstood the bug report, then please ignore my comments.

mikehgentry commented 11 months ago

How are you generating (or finding) the GPXs?

It might help to link one (if you want to preserve privacy about where you are, I suppose you can create it for some random place then simulate navigation in the development plugin to check it's behaving the way you describe).

walterjwhite commented 11 months ago

Hi - I am generating my GPXs from maps.openrouteservice.org and exporting as a 'Standard GPX'. The simple test was navigating in a nearby housing plan and adding waypoints to ensure I hit all of the culdesacs. Doing the same thing within the app results in much less verbosity, the same I'd expect with Google Maps or any other turn-by-turn GPS navigation system.

This is a sample of the route I had issues with before and surmise I would still have issues with. I removed and personal bits from it: https://maps.openrouteservice.org/#/directions/Milbert%20Drive,Franklin%20Park,PA,USA/Dixmont%20Cemetery,Kilbuck,PA,USA/Fort%20Pitt%20Tracery%20(Ohio%20Bastion),Pittsburgh,PA,USA/data/55,130,32,198,15,97,4,224,38,9,96,59,2,24,5,192,166,6,113,0,184,64,90,0,56,0,96,14,152,129,217,8,13,132,129,88,4,99,160,38,66,4,224,25,128,26,0,88,203,164,161,102,108,24,48,167,90,173,14,1,184,137,149,25,78,155,10,29,26,81,227,215,191,102,20,122,170,92,80,137,85,178,75,144,108,93,114,142,23,170,107,234,67,83,30,98,216,150,88,66,136,46,32,32,0,117,71,128,132,70,193,197,0,2,242,128,5,181,194,97,243,246,128,128,3,55,128,1,183,69,199,0,4,243,5,74,64,7,55,198,135,71,200,5,117,78,70,134,241,0,79,66,79,70,44,67,0,203,198,44,130,138,143,68,69,135,69,129,0,5,247,234,0,0

This is the GPX generated from the above route. Change the extension to .gpx. ors-route_1698758182370.gpx.txt

The development plugin seems to have voice prompts that aren't relevant?