[Tagging] layer=-1, rivers, bridges and tunnels

Fernando Trebien fernando.trebien at gmail.com
Fri Mar 14 18:55:39 UTC 2014


I don't think you should be required to check the river's layer tag.
Validators should do this job for you, it's quite easy to write a rule
for that. Here's an example:

Given two ways that cross internally (excluding connections at
endpoints), and considering the "layer value" defined explicitly in a
tag or implicitly 0 when the tag is missing, have the validator issue
a warning in the following situations:

1. The ways have the same layer value and are unconnected. (They
should be connected, or else something is surely missing. This could
actually be considered an "error".)
1.1. Also warn if if one way is a waterway and the other is a highway
and the connection is not explicitly a ford. (It should be, for
clarity. If it's not, it's also possibly not a ford, therefore the
connection is wrong.)
2. The ways have different layer values and both are missing a tunnel
or a bridge tag. (One of them must be either a bridge or a tunnel.
They can both be tunnels or bridges, but they can't be "none of those
two" simultaneously in the real world.)
2.1. Additionally, if one of them is a bridge and the other is a
tunnel or is neither a tunnel nor a bridge: the bridge should have a
greater layer value.
2.2. Similarly, if one is a tunnel, its layer value should be lower if
the other is a bridge or has neither tag.

These rules apply to any arbitrary combination of stacked waterways
and highways that I can think of right now. A few examples using two
overlapping ways:

a. The ways are connected and do not have a layer tag: everything is
ok, no rules issue a warning.
b. The ways are not connected and do not have a layer tag: rule 1
issues a warning. They must either be connected or lie at different
layer levels.
c. The ways are not connected, both have the same layer (say layer=3
or layer=-4), and have no other tags: rule 1 issues a warning. Similar
to situation "b".
d. The ways are not connected and one of them has a layer=-1 tag and
no other tags: rule 2 issues a warning.
e. The ways are not connected and one of them has a layer=1 tag and no
other tags: rule 2 issues a warning too.
f. The ways are not connected, one of them is a bridge with layer=2
and the other is a tunnel with layer=5: rule 2.1 issues a warning.
g. The ways are not connected, one of them is a tunnel with layer=1
and the other is neither a bridge nor has a layer tag (layer=0 is
assumed): rule 2.2 issues a warning.

Actually, situation "d" is what would discourage people from using
layer=-1 to work around today's validator warnings. With this ruleset,
it's impossible to eliminate the warning without actually taking
action on bridges.

On Fri, Mar 14, 2014 at 12:48 PM, fly <lowflight66 at googlemail.com> wrote:
> On 14.03.2014 16:36, Pieren wrote:
>> On Fri, Mar 14, 2014 at 4:15 PM, Jaakko Helleranta.com <jaakko at helleranta.com>
>>
>>> At least OsmAnd renders all waterways with layer=-1 with
>>> dashed casing, as if they were underground, which to me makes sense
>>
>> That's clearly a bug. Waterways underground is specified by "tunnel=*"
>>
>>> So, again : why tag things with with layer= tag when they are essentially on
>>> ground level = not above or below other data (or at least natural objects
>>> that might be mapped one day *) ? Am I missing something here?
>>
>> Real case from real world : a deep ditch where the stream is not
>> "underground" but below the "ground" level, is crossing a village
>> where we have 10 bridges. Either you add 10 times "layer=1" on the
>> bridges or you add 1 time "layer=-1" on the stream.
>
> Well, I do not get your problem, as bridge/tunnel always need a layer
> tag and you already have to cut the ways to tag the bridge/tunnel, why
> not simply add the layer to the bridge/tunnel and leave everything else
> untouched ?
>
> Using layer tags on long ways is discouraged as you often only need it
> on a small part and it makes it more difficult as you always have to
> check the layer tag of these long ways before adding a new bridge/tunnel
> with appropriate layer value.
>
> cu
> fly
>
>
> _______________________________________________
> Tagging mailing list
> Tagging at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/tagging



-- 
Fernando Trebien
+55 (51) 9962-5409

"The speed of computer chips doubles every 18 months." (Moore's law)
"The speed of software halves every 18 months." (Gates' law)



More information about the Tagging mailing list