osmose-backend icon indicating copy to clipboard operation
osmose-backend copied to clipboard

Rule skipped if `set` used for different type (node/way/relation)

Open Famlam opened this issue 1 year ago • 5 comments

I tried to update the mapcss files in preparation for another PR, and saw the following line: # Skip selector using undeclared class TunnelCulvertWithoutWaterway in the py file for https://josm.openstreetmap.de/browser/josm/trunk/resources/data/validator/combinations.mapcss

It came from this rule: # *[tunnel][!highway][!area:highway][!railway][!waterway][!piste:type][type!=tunnel][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=tunnel][power!=cable]!.TunnelCulvertWithoutWaterway (which would match 1998 nodes if parsed correctly)

TunnelCulvertWithoutWaterway is however declared, just not for node/relation:

way[tunnel=culvert][man_made!=tunnel][!waterway] {
  throwWarning: tr("{0} without {1} or {2}", "{0.tag}", "{1.tag}", "{2.key}"); 
  group: tr("suspicious tag combination"); 
  set TunnelCulvertWithoutWaterway; 
}

As it is only set for way rules, the mapcss2osmose script now discards any node/relation rule that refers to it via !.TunnelCulvertWithoutWaterway

(The discarding was done in case it was declared in an "unparsable" rule)

Famlam avatar Feb 17 '23 23:02 Famlam