Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#13877 closed enhancement (fixed)

Warn about waterway=canal as areas

Reported by: naoliv Owned by: team
Priority: normal Milestone: 16.12
Component: Core validator Version:
Keywords: waterway canal Cc:

Description

I saw some closed areas tagged as waterway = canal
https://wiki.openstreetmap.org/wiki/Tag:waterway%3Dcanal says that it's a linear feature only (ie, we should not use it on areas)

If I did the right math, we have 2243 canals as areas in OSM

Is it a worth test?

area:closed[waterway = canal] {
        throwWarning: tr("{0} should not be used on areas", "{1.tag}");
        suggestAlternative: "width";
        suggestAlternative: "waterway=riverbank";
}

Attachments (2)

canals.osm.bz2 (1.5 MB) - added by naoliv 2 years ago.
canals2.osm.bz2 (1.6 MB) - added by Klumbumbus 2 years ago.
file from naoliv but with downloaded members of the multipolygons

Change History (29)

comment:1 Changed 2 years ago by Don-vip

Keywords: waterway canal added

comment:2 in reply to:  description Changed 2 years ago by Klumbumbus

Replying to naoliv:

If I did the right math, we have 2243 canals as areas in OSM

How did you calculate it?

comment:3 Changed 2 years ago by naoliv

I did with the stupid way: downloaded every waterway=canal and validated it :-/

comment:4 Changed 2 years ago by Klumbumbus

Do you still have this data availible? Can you extract all the suspicious objects (double click on the group in the validator tree to select them all) and attach the osm file here?

comment:5 Changed 2 years ago by Klumbumbus

This test could be extended also for waterway=stream|ditch|river|drain.

I wonder if it could produce false positives. canal doesn't imply a flow direction, so closed ways could be possible. Also I wonder if the 4 canals at https://www.openstreetmap.org/#map=17/52.48587/13.49096 are corretly tagged as canal.

comment:6 Changed 2 years ago by Klumbumbus

Milestone: 16.11

comment:7 Changed 2 years ago by naoliv

The correct number is 2305 (I forgot to also test the relations before).

Without #13884, #13885 or #13887 I can't see an easy way to filter only the affected objects.

I can copy them in another layer, but they won't keep their OSM ids (#13885)
I can select all the ways and purge the rest, but for this I also need a way to select their nodes (#13887)

Do you know any other option?

One area with real examples: https://www.openstreetmap.org/way/374711923

comment:8 in reply to:  7 Changed 2 years ago by Klumbumbus

Replying to naoliv:

I can copy them in another layer, but they won't keep their OSM ids (#13885)

Thats not important for this use case here (as long as you paste them at the source position). I just would like to check if I can find false positives in this dataset.

comment:9 in reply to:  7 ; Changed 2 years ago by Klumbumbus

Replying to naoliv:

Do you know any other option?

I did't think about relations, but for ways you can do:

  • select all affected ways
  • add the tag xxx=yyy to the ways
  • select all waynodes (I think requires utilsplugin2)
  • add the tag xxx=yyy to the waynodes
  • search for xxx=yyy
  • invert selection by searching for -selected
  • purge

comment:10 Changed 2 years ago by skyper

+1

Waterways=river;canal;stream;drain;ditch only belong to unclosed ways and relations type=waterway. We uses different tags for water bodies like natural=water or waterway=riverbank.

comment:11 in reply to:  9 ; Changed 2 years ago by skyper

Replying to Klumbumbus:

Replying to naoliv:

Do you know any other option?

directly download with overpass (no need to filter/purge)

I did't think about relations, but for ways you can do:

  • select all affected ways
  • add the tag xxx=yyy to the ways
  • select all waynodes (I think requires utilsplugin2)
  • add the tag xxx=yyy to the waynodes
  • search for xxx=yyy
  • invert selection by searching for -selected
  • purge

Way to complicated !

  1. create another empty layer
  2. select objects
  3. merge selected to empty layer

comment:12 in reply to:  11 Changed 2 years ago by naoliv

Replying to skyper:

directly download with overpass (no need to filter/purge)

How can I select only the closed canals in overpass?
I am already using it (but downloading every canal)

I will try the merge selected option later.

comment:13 in reply to:  11 ; Changed 2 years ago by Klumbumbus

Replying to skyper:

directly download with overpass (no need to filter/purge)

How do you select only closed ways in an overpas query? (The goal was an osm file with all closed ways (+relations) with waterway=canal with their current id)

  1. create another empty layer
  2. select objects
  3. merge selected to empty layer

Yes, thats easier. I never used "merge selected" before :)

comment:14 in reply to:  13 Changed 2 years ago by skyper

Replying to Klumbumbus:

Replying to skyper:

directly download with overpass (no need to filter/purge)

How do you select only closed ways in an overpas query? (The goal was an osm file with all closed ways (+relations) with waterway=canal with their current id)

Sorry, probably mixed up different search/filter.

Still found a solution with purge:

  1. download all ways with waterway=canal (probably can only download from land mass)
  2. search/select all unclosed ways
  3. purge
  4. download relations type=multipolygon waterway=canal

Changed 2 years ago by naoliv

Attachment: canals.osm.bz2 added

comment:15 Changed 2 years ago by naoliv

Merge selected did a better job here.
Selecting -closed and purging them also removed the closed ways.

edit: I should have used type:way -closed, of course :-)

Last edited 2 years ago by naoliv (previous) (diff)

comment:16 Changed 2 years ago by Klumbumbus

OK, we should exclude objects with area=no and or attraction=* to avoid false positives like way/175034247 or way/192657911. However it seems we can't avoid a few false positives for e.g. way/114691942 or way/225105909. (The last example is actually mapped wrong, but it could be a false positive if the multipolygon wouldn't be present.)

Last edited 2 years ago by Klumbumbus (previous) (diff)

comment:17 Changed 2 years ago by naoliv

Aren't way/192657911 and way/114691942 missing area=no?

comment:18 Changed 2 years ago by Klumbumbus

You can add it, however this is not mandatory as far as I know.

comment:19 Changed 2 years ago by Klumbumbus

...because waterway=canal is a linear feature only and not an area feature

comment:20 Changed 2 years ago by naoliv

Then it won't be possible to distinguish this wrong canal way/230145073 from way/114691942, for example.

comment:21 Changed 2 years ago by Klumbumbus

Yes thats what I was trying to say with "However it seems we can't avoid a few false positives for e.g. ​way/114691942 or ​way/225105909."

You can only know whether they are right or wrong from knowing the context. Both should be interpreted as linear ways. osm-carto fails there when it draws closed ways with waterway=canal as area by default. If it would draw it as linear feature we would probably have less wrongly as areas mapped waterway=canals :)

comment:22 Changed 2 years ago by naoliv

I am opening a ticket in openstreetmap-carto

comment:23 Changed 2 years ago by naoliv

At https://github.com/gravitystorm/openstreetmap-carto/issues/2424

I guess it's not possible to anything in JOSM then, right?

comment:24 in reply to:  23 Changed 2 years ago by Klumbumbus

Replying to naoliv:

I guess it's not possible to anything in JOSM then, right?

I think we should add the test anyway. The relative and total number of false positives is very low. (This may change in the future, though.)

Changed 2 years ago by Klumbumbus

Attachment: canals2.osm.bz2 added

file from naoliv but with downloaded members of the multipolygons

comment:25 Changed 2 years ago by Klumbumbus

Resolution: fixed
Status: newclosed

In 11232/josm:

  • fix #13877 - warn about linear waterway tags used on areas (modified patch by naoliv)
  • fix #13879 - warn about values of tracktype other than grade1|grade2|grade3|grade4|grade5

comment:26 Changed 2 years ago by Don-vip

Milestone: 16.1116.12

Milestone renamed

comment:27 in reply to:  23 Changed 2 years ago by Klumbumbus

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.