Modify

Opened 10 years ago

Closed 8 years ago

Last modified 3 years ago

#9182 closed enhancement (fixed)

checks for layer=-1 on waterways

Reported by: RicoZ Owned by: team
Priority: normal Milestone: 16.06
Component: Core validator Version:
Keywords: Cc: RicoZ

Description

I have seen some users tagging whole rivers, canals, and riverbanks with layer=-1 with no valid reason - sometimes for a whole country or region. It would be great if the validator could issue warnings in such cases.

As far as I can see there is a quick and easy check: a waterway that is not a tunnel should never ever have layer=-1. Only when two waterway tunnels are crossing an extra layer tag may be required. This would catch over 99% of cases with minimal effort.

Attachments (0)

Change History (30)

in reply to:  description ; comment:1 by AlfonZ, 10 years ago

Replying to RicoZ:

a waterway that is not a tunnel should never ever have layer=-1.

Maybe the error is not the extra layer=-1 but missing tunnel=* ;)

in reply to:  1 ; comment:2 by skyper, 10 years ago

Replying to AlfonZ:

Replying to RicoZ:

a waterway that is not a tunnel should never ever have layer=-1.

Well, this is a bit too strict, but there won't be that many special cases.

Maybe the error is not the extra layer=-1 but missing tunnel=* ;)

No, it is incorrect/old tagging to avoid warnings. Sadly this way, you will not find missing tunnels or bridges.

in reply to:  2 ; comment:3 by RicoZ, 10 years ago

Replying to skyper:

Replying to AlfonZ:

Replying to RicoZ:

a waterway that is not a tunnel should never ever have layer=-1.

Well, this is a bit too strict, but there won't be that many special cases.

I would be curious about an example of such a special case?

I have been told that it might be used to tag underground rivers but to me it would appear preferable to have a distinct tag for underground_river.. in absence of that I would probably tag it with tunnel and vote for a new tag.

in reply to:  1 comment:4 by RicoZ, 10 years ago

Replying to AlfonZ:

Replying to RicoZ:

a waterway that is not a tunnel should never ever have layer=-1.

Maybe the error is not the extra layer=-1 but missing tunnel=* ;)

The missing tunnel or bridge is an error in itself, in fact I have seen users adding layer=-1 to suppress warning about missing bridges..

From the wiki

http://wiki.openstreetmap.org/wiki/Key:layer "Things to avoid"

  • Rivers and streams should not be tagged with layer -1 along their entire length. Some people do however advocate tagging rivers and streams at layer -1 where they pass under a succession of bridges, using layer=0 for the bridge. Any other intersecting ways however need to have a correct layer tag then as well (for example, an underground pipeline would need to be layer=-2 to cross under the stream).

So I would regard a useless layer=-1 as an error on itself, or at least something that should be avoided unless there is a good reason. The only valid reason that I can think off is waterway in tunnel or on bridge. Otoh a bridge going over the river is not usually a sufficient reason to tag the river with layer=-1.

I have seen people doing it because they "think it is logical that a river is lower than surrounding ground" and people deliberately using it to silence validation warnings from keepright and other validators about missing bridges, tunnels and rivers crossing riverbanks. Do not ask me why this people use validators at all;)

Noticed that because mapsforge ( http://code.google.com/p/mapsforge/ ) based renderers such as Oruxmaps will not render such rivers when they are passing through forrests etc.

comment:5 by RicoZ, 10 years ago

Cc: RicoZ added

in reply to:  3 ; comment:6 by skyper, 10 years ago

Replying to RicoZ:

Replying to skyper:

Replying to AlfonZ:

Replying to RicoZ:

a waterway that is not a tunnel should never ever have layer=-1.

Well, this is a bit too strict, but there won't be that many special cases.

I would be curious about an example of such a special case?

Like several bridges on different levels and a waterway underneath or the "waterway + bridge in a big tunnel" example.

Anyway, I meant your statement, especially "never ever", which is too strict.

  • I have no problem with a warning about waterway without tunnel and negative layer value.
Last edited 10 years ago by skyper (previous) (diff)

in reply to:  6 comment:7 by RicoZ, 10 years ago

Replying to skyper:

Replying to RicoZ:

Replying to skyper:

Replying to AlfonZ:

Replying to RicoZ:

a waterway that is not a tunnel should never ever have layer=-1.

Well, this is a bit too strict, but there won't be that many special cases.

I would be curious about an example of such a special case?

Like several bridges on different levels and a waterway underneath or the "waterway + bridge in a big tunnel" example.

Not even sure for the first example but the second surely would have a layer for the waterway - for that reason my original post did exclude waterways in tunnels.

Your example reminds me, someday I would like to map the "Caverna Gaggi". Waterway, tunnel passing on a bridge through a cave.

Anyway, I meant your statement, especially "never ever", which is too strict.

  • I have no problem with a warning about waterway without tunnel and negative layer value.

so far I am convinced the rate of false positives would be extremely low, have not really seen an actual example.

comment:8 by mkoniecz, 10 years ago

Layer=-1 for river under bridge should not generate warning, encouraging useless retagging is a bad idea.

Also - I see no reason for considering "river spanning over country has tag layer=-1 over entire length" as a problem.

Last edited 10 years ago by mkoniecz (previous) (diff)

in reply to:  8 comment:9 by skyper, 10 years ago

Replying to Bulwersator:

Layer=-1 for river under bridge should not generate warning, encouraging useless retagging is a bad idea.

We try to encourage to map bridges and tunnels.

Also - I see no reason for considering "river spanning over country has tag layer=-1 over entire length" as a problem.

This will not raise warnings at the moment. Only use layer where really needed and please do not add it to long ways without tunnel.

All together we propably need better/more checks on layers. Just did delete several negative layer on natural and landuse. Later might be connected with the rendering problems of waterways with negative layer.

in reply to:  8 comment:10 by RicoZ, 10 years ago

Replying to Bulwersator:

Layer=-1 for river under bridge should not generate warning, encouraging useless retagging is a bad idea.

Also - I see no reason for considering "river spanning over country has tag layer=-1 over entire length" as a problem.

it has been used to silence warnings about missing bridges, ill formed riverbanks etc. The wiki documentation says don't do it and the mapsforge renderer will rely on it - rivers with layer=-1 will not be drawn where they conflict with landuse=forest etc.

comment:11 by RicoZ, 10 years ago

better/more layer checks for the general case would not hurt but the waterway=* && layer=-1 && !(tunnel or bridge or waterfall) case is somewhat urgent to catch because current validator behavior seems to encourage bad practice. As long as many other errors such as missing bridge, culvert or crossing waterways are marked with a warning and only the layer=-1 slips through there will be contributors thinking it is a correct way to fix these warnings.

Waterfalls are somewhat imprecisely specified so I would also exclude them from the check for now.

Perhaps, warnings should be grouped into types, such as

  • probable errors - (waterways crossing)
  • probably missing information - (waterway-highway-xing)

in reply to:  8 comment:12 by RicoZ, 10 years ago

Replying to Bulwersator:

Layer=-1 for river under bridge should not generate warning, encouraging useless retagging is a bad idea.

that would make sense for the relatively rare case of waterways under bridges marked with layer=0. But the rationale for marking bridges as layer=0 is somewhat fragile, in most cases where people mark bridges with level=0 the reasoning is something that "the bridge is not elevated/raised in relation to the road or nearby ground" which I find problematic because layer should be used to mark only ways that are directly intersecting. Using it to mark relative height differences with nearby features is discouraged for good reasons - otherwise the transitivity of the "nearby" or "adjoining" relation would cause a lot more problems than it would solve.

Otoh a bridge with layer=1 over a waterway with layer=-1 would be strange unless there were a layer inbetween and I can not think of a case where that makes sense right now?

comment:13 by RicoZ, 10 years ago

Seems that a quick and easy layer-value check would not hurt either:

http://taginfo.openstreetmap.org/keys/?key=layer#values

in reply to:  13 ; comment:14 by AlfonZ, 10 years ago

Replying to RicoZ:

Seems that a quick and easy layer-value check would not hurt either:

http://taginfo.openstreetmap.org/keys/?key=layer#values

A check for layer values has been added in r6251.

Digging into history, there used to be a validator check for waterways without layer, added in [o9909] (2008-08-17) and disabled in [o10024] (2008-08-20). Although it was just a couple of days, maybe the waterways you are seeing are remnants that era?

in reply to:  14 comment:15 by RicoZ, 10 years ago

Replying to AlfonZ:

Replying to RicoZ:

Seems that a quick and easy layer-value check would not hurt either:

http://taginfo.openstreetmap.org/keys/?key=layer#values

A check for layer values has been added in r6251.

looks good, I hope the other checks won't be much more complicated?

Digging into history, there used to be a validator check for waterways without layer, added in [o9909] (2008-08-17) and disabled in [o10024] (2008-08-20). Although it was just a couple of days, maybe the waterways you are seeing are remnants that era?

no, definitely not it although it could have influenced later events. The waterway changes that prompted me asking for this extension of the validator are all from this year.

comment:16 by RicoZ, 10 years ago

I have been experimenting with a very simple approach and believe some basic checks could be added easily and would be of significant value:

waterway=* layer=-1 -tunnel=* -culvert=yes -covered=yes -pipeline=yes nodes:3-

  • checked thousands of those without seeing a false positive.

waterway=* layer=-1 -tunnel=* -culvert=yes -covered=yes -pipeline=yes nodes:1-2

  • here we have a 60-80% chance of a tunnel=culvert missing, most of the rest are under a bridge with its own layer so an additional layer tag for the waterway does not make sense here. No real false positives afaics.

Have been experimenting with a generalized approach for other ways:

(highway | railway=rail |waterway) -layer=0 layer=* -tunnel=* -bridge=* -culvert=yes -*=steps -*=elevator -covered=yes

  • getting very few false positives in rural areas, in big cities it catches some indoor mapping attempts (or workarounds) at railway stations, underground malls etc - still very low false positive rate.
  • layer=0 is not recommended and in most cases inappropriate but without excluding it I got just too much hits to see real problems. However the validator should probably still warn about it. It should almost certainly warn if a very long way is tagged with layer=0 (or any other layer)

comment:17 by mkoniecz, 10 years ago

see #9365 - layer=0 is since r6447 detected by validator as bogus and removed (like unattached nodes without tags).

in reply to:  17 comment:18 by RicoZ, 10 years ago

Replying to Bulwersator:

see #9365 - layer=0 is since r6447 detected by validator as bogus and removed (like unattached nodes without tags).

very good.. well I was running my tests with real world data mostly from Austria and Germany and here layer=0 is still around in a few places.

comment:19 by mkoniecz, 10 years ago

I know, I replied to "However the validator should probably still warn about it".

comment:20 by anonymous, 10 years ago

I have done a few tests in New Your City and Los Angeles, most of Manhattan, airports and areas that seemed complex. With

(highway | railway=rail |waterway) -layer=0 layer=* -tunnel=* -bridge=* -culvert=yes -*=steps -*=elevator -covered=yes

there were no false positives.

In Chicago, things are quite a bit more difficult. First I had to add "-indoor=yes" to filter out results which I could not verify at all - although I suspect that some of these would be better tagged with level.
Even with that restriction I got 149 hits in central Chicago (Chicago Loop). Lot of them were missing bridges or tunnels but there were also many multi-level roads etc which I could not verify and it is quite possible that this area is so complex that this simple test will fail on it.

comment:21 by RicoZ, 10 years ago

.. just noticed that I was accidentally logged out when doing my previous comment.

comment:22 by RicoZ, 8 years ago

ping - what is the state of this? I have been running a few tests with

waterway=* layer=-1 -tunnel=* -culvert=yes -covered=yes -pipeline=yes -location=underground nodes:300-

and found quite a lot including some interesting examples like rivers overlapping other rivers and plenty of other errors which were only possible because the layer=-1 hides most errors.

Wrote over 50 private messages to mappers doing it in the last few days and all but one say they are no longer doing it and are trying to clean it up. Quite a few say they used layer=-1 to hide JOSM or Keepright warnings.

So imho some test like this is needed, otherwise the warnings about waterway crossing highway cause more harm then good.

comment:23 by ffla, 8 years ago

RicoZ,

will try my best as soon as I have some spare time - JOSM should help, at least I hope so.

Thanx & Best Regards,
Flavio

comment:24 by Klumbumbus, 8 years ago

Milestone: 16.06

comment:25 by Klumbumbus, 8 years ago

Resolution: fixed
Status: newclosed

In 10388/josm:

fix #9182 - warn about waterways with negative layer but without a tunnel tag. (if <400m then only at info level)

comment:26 by holgermappt, 8 years ago

Can you use layer and tunnel in the message instead of {0} and {1}? The translation of negative {0} would be negativem/negtiver {0} in German, but negative layer is unambiguous and can be translated with negativer Ebene.

comment:27 by holgermappt, 8 years ago

There is no message if waylength is exactly 400m. Should one version include an equal sign, e.g. [eval(waylength()) >= 400]?

comment:28 by Klumbumbus, 8 years ago

In 10419/josm:

fix #12973 - fix intermittent-dashes for natural=water and waterway=riverbank multipolygons; see #9182 - adjust negative layer warning messages; remove unnecessary spaces

in reply to:  26 comment:29 by Klumbumbus, 8 years ago

Replying to holgermappt:

Can you use layer and tunnel in the message instead of {0} and {1}?

One main reason to use these placeholders for me is the feature improvement to display words which are tags different (see #11153). So I kept them but adjusted the message, so it should be translatable properly now.

comment:30 by skyper, 3 years ago

There is the discussion about removing this test in favor of a more general test, see #9819.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.