rinigus / pure-maps

Maps and navigation
https://rinigus.github.io/pure-maps/
GNU General Public License v3.0
243 stars 43 forks source link

[Feature Request] Better UI Support for Tunnels #661

Open kop316 opened 1 year ago

kop316 commented 1 year ago

Hello!

So where I live, there are quite a few tunnels. Right now with Pure Maps, if you go into a tunnel, you "stop" right at the beginning of the tunnel (since geoclue stops providing updates), and when you come out the other side (and GPS picks back up), you "jump" to the opposite side. While this is perfectly understandable as to why this is happening, this is probably not optimal from a UI perspective.

I tried a few tests with Google Maps on iOS to see what it does in tunnels. From what I can tell, what it appears to do is take the last known speed before GPS loss, and use that as the assumed speed of the device and keeps it on the correct navigation. This way, the device looks to still be going through the tunnel. If the UI gets to the end of the tunnel before GPS picks back up, it "stops" at the end of the tunnel and waits for GPS to pick back up.

It would be nice if Pure Maps could do something similar to this.

rinigus commented 1 year ago

There was a discussion regarding it some years ago and I decided against implementing it. With the tunnels you can also have branching (tunnel splitting into 2) and it is tricky to implement it. I will keep the issue open, maybe someone would like to dive into it and implement such tunnel support

kop316 commented 1 year ago

With the tunnels you can also have branching (tunnel splitting into 2) and it is tricky to implement it.

I understand that concern. I am wondering, how common are tunnels that branch? The only one I know of is in Boston (the big dig), but I am not too familiar with it. I would additionally be curious how e.g. Google Maps accounts for that too? Perhaps they just assume you always take the right direction (which isn't a good assumption).

Perhaps someone who can test wouldn't mind commenting (assuming they stumble upon this).

Karry commented 1 year ago

Hi guys. I implemented position estimate in tunnels for OSMScout. It was not so hard. During navigation, router gives you suggested way to the finish, so application can assume that driver will follow that way even in tunnel and application may just move estimated position that way, until it reach the tunnel exit or gets gps update...

Regarding branches, some tunnels may have multiple exits [1] and I saw even roundabout [2] !

1) https://www.openstreetmap.org/relation/5519843 2) https://www.openstreetmap.org/way/11710153

kop316 commented 1 year ago

@Karry thanks for the explanation! I sort of assumed that is what Google Maps would do to, but I figured it was safer to have someone confirm rather than me guess. Before testing, I sort of assumed Google would have some really fancy way of knowing (maybe use the accelerometer as an INU?). It's always fun to find out that the simple solution one thinks up is actually used commercially.

Regarding the links, they appear to be the same (I wanted to see the roundabout!)?

Karry commented 1 year ago

Ou, sorry. The roundabout is here: https://www.openstreetmap.org/way/11710153 it is made under the Tromso in Norway.

rinigus commented 1 year ago

OK, let's consider few other details:

So, it is possible and probably not as difficult, but relatively limited. For me, it would be lower priority than many other issues in Pure Maps and OSM Scout Server. But developers are welcome to implement it.

kop316 commented 1 year ago
* the simpler solution would work for routing only. When we don't have the route then it is difficult to say where you want to go

I agree, I think that is reasonable

* obviously, Pure Maps should detect that we are entering a tunnel. This would require either working map matching with OSM Scout Server (can be used in combination with online/offline/HERE modes) or designation in router that corresponding path is in the tunnel (haven't looked into it)
* tunnel branching is probably not that uncommon for longer tunnels - tunnels where such feature could be of interest.

Yeah this makes sense as well.

So, it is possible and probably not as difficult, but relatively limited. For me, it would be lower priority than many other issues in Pure Maps and OSM Scout Server. But developers are welcome to implement it.

I agree, this isn't a high priority. But I figured it is at least worth documenting as an issue and a possible solution in case others see it as well (and someone wants to implement it).

rinigus commented 1 year ago

Agreed, let's keep it open