Modify

Opened 12 years ago

Closed 12 years ago

#9683 closed enhancement (duplicate)

Detect missing railway=level_crossing

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

Description

Could JOSM detect (and autofix, if possible), missing railway=level_crossing (railway intersecting with highway != footway|path) and railway=crossing (railway intersecting with highway = footway|path)?

Attachments (1)

crossing.osm (858 bytes ) - added by naoliv 12 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by simon04, 12 years ago

JOSM currently warns "Crossing ways" when a railway and a highway cross …

by naoliv, 12 years ago

Attachment: crossing.osm added

comment:2 by naoliv, 12 years ago

I can't see anything with the attached example.
Note that I am talking about the intersection node (it misses a railway=level_crossing)

comment:3 by simon04, 12 years ago

Confirmed. I tested without a the node at the crossing …

An unfinished MapCSS test (which matches every node if a way has both highway and railway set)

node[railway!=level_crossing][has_parent_tag("highway")][not(regexp_test("footway|path", parent_tag("highway")))][has_parent_tag("railway")] {
  throwWarning: tr("highway/railway crossing without {0}", "{0.tag}");
  fixAdd: "railway=level_crossing";
}

node[railway!=crossing][has_parent_tag("highway")][regexp_test("footway|path", parent_tag("highway"))][has_parent_tag("railway")] {
  throwWarning: tr("highway/railway crossing without {0}", "{0.tag}");
  fixAdd: "railway=crossing";
}

With the following MapCSS function added.

  • src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java b/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
    index d0e47a8..1415400 100644
    a b public final class ExpressionFactory {  
    324324            return env.parent.get(key);
    325325        }
    326326
     327        public boolean has_parent_tag(String key) {
     328            String parentTag = parent_tag(key);
     329            return parentTag != null && !parentTag.isEmpty();
     330        }
     331
    327332        /**
    328333         * Determines whether the object has a tag with the given key.
    329334         */

comment:4 by mkoniecz, 12 years ago

See #9298 for the same request.

comment:5 by Don-vip, 12 years ago

Resolution: duplicate
Status: newclosed
Type: defectenhancement

Closed as duplicate of #9298.

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.