Modify

Opened 2 months ago

Closed 2 months ago

Last modified 4 weeks 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 Changed 2 months ago by anonymous

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 Changed 2 months ago by GerdP

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 Changed 2 months ago by naoliv

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 Changed 2 months ago by GerdP

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 Changed 4 weeks ago by Don-vip

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.