Opened 8 years ago

Closed 8 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:


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 8 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by simon04

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

Changed 8 years ago by naoliv

Attachment: crossing.osm added

comment:2 Changed 8 years ago by naoliv

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 Changed 8 years ago by simon04

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/

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

comment:4 Changed 8 years ago by mkoniecz

See #9298 for the same request.

comment:5 Changed 8 years ago by Don-vip

Resolution: duplicate
Status: newclosed
Type: defectenhancement

Closed as duplicate of #9298.

Modify Ticket

Change Properties
Set your email in Preferences
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.