Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#17108 closed defect (fixed)

Should not warn about unclosed way with natural=tree

Reported by: naoliv Owned by: team
Priority: normal Milestone: 18.12
Component: Core validator Version:
Keywords: Cc:

Description

Have an unclosed way with natural=tree and validate it.
We can see 2 warnings:

  • natural=tree on a way. Should be used on a node.
  • Unclosed way - natural type tree

The first warning is right while the second not.

I am not really sure if this is the most correct solution but it solves the problem:

  • src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java

    diff --git a/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java b/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java
    index e44a5b440..cc306c4cb 100644
    a b public class UnclosedWays extends Test {  
    135135    private static final UnclosedWaysCheck[] checks = {
    136136        // CHECKSTYLE.OFF: SingleSpaceSeparator
    137137        new UnclosedWaysCheck(1101, "natural",   marktr("natural type {0}"),
    138                 new HashSet<>(Arrays.asList("cave", "coastline", "cliff", "tree_row", "ridge", "valley", "arete", "gorge", "gully"))),
     138                new HashSet<>(Arrays.asList("cave", "coastline", "cliff", "tree", "tree_row", "ridge", "valley", "arete", "gorge", "gully"))),
    139139        new UnclosedWaysCheck(1102, "landuse",   marktr("landuse type {0}")),
    140140        new UnclosedWaysCheck(1103, "amenities", marktr("amenities type {0}")),
    141141        new UnclosedWaysCheck(1104, "sport",     marktr("sport type {0}"),

Attachments (0)

Change History (5)

comment:1 by anonymous, 6 years ago

I am not really sure if this is the most correct solution but it solves the problem:

It looks perfectly correct to me.

comment:2 by GerdP, 6 years ago

Taginfo shows a lot more natural values that can be used on nodes. We have a mapcss rule that treats peak, saddle, volcano, and tree the same. So I think we must add those to avoid duplicate messages.

comment:3 by naoliv, 6 years ago

With the new values (also sorted them):

  • src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java

    diff --git a/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java b/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java
    index e44a5b440..58d8f6621 100644
    a b public class UnclosedWays extends Test {  
    135135    private static final UnclosedWaysCheck[] checks = {
    136136        // CHECKSTYLE.OFF: SingleSpaceSeparator
    137137        new UnclosedWaysCheck(1101, "natural",   marktr("natural type {0}"),
    138                 new HashSet<>(Arrays.asList("cave", "coastline", "cliff", "tree_row", "ridge", "valley", "arete", "gorge", "gully"))),
     138                new HashSet<>(Arrays.asList("arete", "cave", "cliff", "coastline", "gorge", "gully", "peak", "ridge", "saddle", "tree", "tree_row", "valley", "volcano"))),
    139139        new UnclosedWaysCheck(1102, "landuse",   marktr("landuse type {0}")),
    140140        new UnclosedWaysCheck(1103, "amenities", marktr("amenities type {0}")),
    141141        new UnclosedWaysCheck(1104, "sport",     marktr("sport type {0}"),

comment:4 by GerdP, 6 years ago

Resolution: fixed
Status: newclosed

In 14559/josm:

fix #17108 avoid duplicate warning for unclosed ways which are also tested in geometry.mapcss rule "{0} on a way, should be a node"

comment:5 by Don-vip, 6 years ago

Milestone: 18.12

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.