Openstreetmap-carto: Presence of multiple tags stating a thing is located underground are ignored in some cases

Created on 8 May 2019  ·  13Comments  ·  Source: gravitystorm/openstreetmap-carto

I rewrote the description to better describe the problem. The original text can be found below.

Expected behavior

Every way tagged layer=-1 AND level=-1 AND location=underground should be rendered underneath all other ways (if they have about the same importance, e. g. roads, paths and rails) with no layer tag or a positive layer tag.

The tag bridge=yes indicates if an object is a bridge. This is a structural property.
The tag layer=* indicates the vertical order of objects. This is a positional property.
The tag location=* indicates where an object is located relative to its surroundings, e. g. the ground or an area of water. This also is a positional property.

Rendering order should

  1. represent importance of objects (roads and rails above landuses and water).
  2. represent the actual vertical position of things, for example in case of grade separated crossings.

If the definitions of the described positional tags are implemented precisely, all grade separated crossings can be shown correctly, no matter if they are common or unusual.

Actual behavior

Instead, ways tagged bridge=yes are always rendered above other ways, ignoring the value of layer=*, level=* and location=*. That is not correct in some cases:

  • if the bridge has a negative layer value, e. g. layer=-1
  • if the bridge is stated not to be overground (location=underground, location=underwater)

Links and screenshots illustrating the problem

This applies to bridges that are under the ground, for example for underground railways:
map
This picture shows rails drawn incorrectly above the roads.
In fact, the roads are on ground level (layer 0). Below, there is a large underground hall. On the floor of the hall (layer -2) there are east-west rails. The hall is crossed by a bridge bearing north-south rails (layer -1) which is located _inside_ the hall.

https://osm.org/go/0GMNF91Ib
Ways:
https://www.openstreetmap.org/way/80881083
https://www.openstreetmap.org/way/90242586

photos to imagine the described situation:

Original Issue

Expected behavior

Every way tagged layer=-1 should be rendered underneath all other ways with no layer tag or a positive layer tag.

### Actual behavior
Instead, ways tagged bridge=yes are always rendered above other ways, ignoring the value of layer=*. That is not correct if the way (bridge=yes) has a negative layer value, e. g. layer=-1.

Links and screenshots illustrating the problem>

This applies to bridges that are under the ground, for example for underground railways:
map
https://osm.org/go/0GMNF91Ib
Ways:
https://www.openstreetmap.org/way/80881083
https://www.openstreetmap.org/way/90242586

A photo to imagine one possible situation:
https://www.bogestra.de/fileadmin/dam/jpg/Haltestellen/_H__Bahnhof_Rathaus_S%C3%BCd_mit_3_Bahnen_2.jpg (may be protected by copyrights)

roads

Most helpful comment

I'm sorry for accidentally closeing, I won't try using github on mobile again.

All 13 comments

“bridges that are under the ground”

Usually a bridge or viaduct is an above-ground structure.

I’m having trouble imagining a situation where a subway or other
underground railway has built an underground viaduct.

Isn’t this situation usually handled by having tunnels at different levels?
I would think that railways would be tagged as tunnels with different layer
tags.

“bridges that are under the ground”
Usually a bridge or viaduct is an above-ground structure.

Indeed this is is unusual. Thats why it is okay that bridges are drawn above other ways by default. But an explicitly given tag should always overwrite defaults, so should layer=-1 do.

I've added a link to a picture in the issue description, for better understanding of one possible situation.

Possible solution would be to ignore bridge tag if tunnel tag (with a valid tunnel value) is present.

"Expected behavior Every way tagged layer=-1 should be rendered underneath all other ways with no layer tag or a positive layer tag. "

Not so. For one key:layer has a defined meaning only in a few well defined combinations like layer=+bridge=. As of bridges bellow other features look at https://wiki.openstreetmap.org/wiki/Key:layer#Data_consumers . This may seem very ad-hoc but I suspect you can not change anything written in that section without causing major breakage (or manually fixing zillions of places in the database).. I have personally seen literally thousands of cases where someone used layer=-1+bridge where here really wanted layer=1.

The way to map the situation you are trying to map is either some kind of indoor mapping or man_made=tunnel+location=tunnel
https://wiki.openstreetmap.org/wiki/Proposed_features/man_made%3Dtunnel
https://wiki.openstreetmap.org/wiki/Proposed_features/Simplify_man_made%3Dbridge_mapping

Looking at the examples I think in this case location=underground should also work (or should be made to work). The combination tunnel+bridge is undefined.. could be only defined arbitrarily or ignored. Here is where man_made=tunnel would be better though afaics no renderer currently supports any of this solutions.

Actually, this example is tagged location=underground. So according https://wiki.openstreetmap.org/wiki/Key:layer#Data_consumers this should be enough reason for this to be rendered underneath the ground-level road. Maybe not because of the layer tag, but at least because of the location=underground tag.

man_made=tunnel is not suitable here, because it is a main tag. The main feature of this way is still railway=subway, as most similar cases will have some railway=* or highway=* tag as main tag.

Even though location=underground should work you can not map this situation as tunnel=yes+bridge=yes. Afaics we have no way to do this, maybe man_made=tunnel some day. Or invent bridge:underground= or similar.. it would certainly "fix" the rendering.

Anyway, what kind of rendering do you expect? I think the reasonable rendering would be to "ignore" the bridge attribute?

@matkoniecz: would work in this case but seems rather adhoc. Someone may also try to map a tunnel on a bridge (quite often there is a lower level of a bridge that looks like a tunnel) and than this would be wrong. We could use location, layer and level to decide that but I think the situation should be foremost clarified in the ml and wiki.

This issue is requesting that layer= be considered more important than the presence of bridge= or tunnel= for rendering layer.

I believe that this may not work for our style, because the basic bridge= and tunnel= tags are more likely to be correct than the order of the layer= tags at complex locations. It would also be extremely complex to combine all the layers between bridge and tunnel so that they can all be reordered freely at time of rendering, based primarily on layer= or other tags.

@pnorman, @imagico - there was some discussion about trying to do this previously. Is there still a plan to combine the layers in such a way? Would this then make it possible solve this issue as requested?

The alternative to fix the specific places mentioned above and similar locations would be to treat a railway or highway with both tunnel= and bridge= as only a tunnel or only a bridge. This could be done now, in theory.

But there are only 67 highway ways and 31 railway ways with both bridge=yes and tunnel=yes and layer=-1 or -2, compared to 161 highway ways and 34 railway ways with bridge=yes+tunnel=yes+layer=1 or 2, so this combination is slightly more likely to represent an above-grade feature, based on the percentage of positive vs negative layer tags.

I rewrote the issue description to better describe the problem.

I really hope this will get fixed soon. It is hard to convince people of using OSM if they look at openstreetmap.org and one of the first things they see is this striking bug right in front of the town hall, in the middle of the city centre.

The situation that @DerDings is trying to depict is like this:

This whole subway station (this) is a big room underground and one of the subway lines "flies" over the other by a slab-like structure. But in our case, we didn't use bridge tag.

But in our case, we didn't use bridge tag.

I cannot determine from the pictures if bridge is necessary in the depicted construction.
But this
Uploading Stadtbahn_Bochum_Rathaus_(Süd)_2001141550.jpg…
is pretty much a basic bridge: A slab borne by a support at each end.

I'm sorry for accidentally closeing, I won't try using github on mobile again.

Was this page helpful?
0 / 5 - 0 ratings