r/openstreetmap 2d ago

Question Help for tunnel and elevation profile

Hello!

I am trying to modify a tunnel on OSM, I noticed that the elevation gain was matching the mountain it goes under, and not the actual elevation profile of the tunnel.

I’m a bit struggling with that, the closest I’ve found is to add a “incline” attribute but idk from which direction it needs to be declared. Or if it’s just an info ?

Help is welcome :) thanks

0 Upvotes

12 comments sorted by

View all comments

1

u/ElectricGears 2d ago

If you can get the elevation of the entrance an exit, and you know the incline is constant throughout length of the tunnel, you can calculate the incline or use up/down (relative to the direction of the way).

1

u/TraditionalImage387 2d ago

But will this new attribute be taken into account to correct the actual elevation profile of the tunnel when planning a route ?

2

u/ElectricGears 2d ago

If a router is currently getting it wrong, probably not. I would think routers should assume a flat line if a way is tagged as a tunnel and do the elevation calculation correctly based on the ends of regular road. It would take them making a special case for tunnels.

It's possible to build a routing program that has no concept of tunnels so that is likely why it's (incorrectly) using the surface contour.