Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 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 8 years ago.
canals2.osm.bz2 (1.6 MB ) - added by Klumbumbus 8 years ago.
file from naoliv but with downloaded members of the multipolygons

Change History (29)

comment:1 by Don-vip, 8 years ago

Keywords: waterway canal added

in reply to:  description comment:2 by Klumbumbus, 8 years ago

Replying to naoliv:

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

How did you calculate it?

comment:3 by naoliv, 8 years ago

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

comment:4 by Klumbumbus, 8 years ago

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 by Klumbumbus, 8 years ago

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 by Klumbumbus, 8 years ago

Milestone: 16.11

comment:7 by naoliv, 8 years ago

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

in reply to:  7 comment:8 by Klumbumbus, 8 years ago

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.

in reply to:  7 ; comment:9 by Klumbumbus, 8 years ago

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 by skyper, 8 years ago

+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.

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

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

in reply to:  11 comment:12 by naoliv, 8 years ago

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.

in reply to:  11 ; comment:13 by Klumbumbus, 8 years ago

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 :)

in reply to:  13 comment:14 by skyper, 8 years ago

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

by naoliv, 8 years ago

Attachment: canals.osm.bz2 added

comment:15 by naoliv, 8 years ago

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 8 years ago by naoliv (previous) (diff)

comment:16 by Klumbumbus, 8 years ago

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 8 years ago by Klumbumbus (previous) (diff)

comment:17 by naoliv, 8 years ago

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

comment:18 by Klumbumbus, 8 years ago

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

comment:19 by Klumbumbus, 8 years ago

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

comment:20 by naoliv, 8 years ago

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

comment:21 by Klumbumbus, 8 years ago

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 by naoliv, 8 years ago

I am opening a ticket in openstreetmap-carto

comment:23 by naoliv, 8 years ago

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

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

in reply to:  23 comment:24 by Klumbumbus, 8 years ago

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.)

by Klumbumbus, 8 years ago

Attachment: canals2.osm.bz2 added

file from naoliv but with downloaded members of the multipolygons

comment:25 by Klumbumbus, 8 years ago

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 by Don-vip, 8 years ago

Milestone: 16.1116.12

Milestone renamed

in reply to:  23 comment:27 by Klumbumbus, 8 years ago

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.