#10837 closed enhancement (fixed)
Some more validation rules for JOSM — at Version 23
| Reported by: | naoliv | Owned by: | Klumbumbus |
|---|---|---|---|
| Priority: | normal | Milestone: | 14.12 |
| Component: | Core validator | Version: | |
| Keywords: | mapcss | Cc: |
Description (last modified by )
Good that you have included #10825 :-)
I have some more rules that we are using here that probably could be used everywhere else (and maybe you could be interested in including some of them in JOSM)
/* is using any other *_name tag but not a name */ *[/_name$/][!name] { throwWarning: tr("using alternative name without {0}", "{1.key}"); }
Done.
/* using nomame = yes + name is contradictory */ *[noname?][name] { throwWarning: tr("contradictory use of {0} and {1}", "{0.key}", "{1.key}"); }
Done.
/* follows http://wiki.openstreetmap.org/wiki/Proposed_features/drop_recommendation_for_place_name */ /* when name = place_name we just remove place_name */ *[place][place_name = *name] { throwWarning: tr("{0} = {1}; remove {0}", "{1.key}", "{1.value}"); fixRemove: "{1.key}"; } /* when it has place_name but not name, we rename place_name to name */ *[place][place_name][!name] { throwWarning: tr("do not use {0}", "{1.key}"); suggestAlternative: "name"; fixChangeKey: "{1.key} => {2.key}"; }
Done.
/* the highway "name" already define it's own address; it's strange to also have a "addr:street" on highways */ *[highway]["addr:street"] { throwWarning: tr("{0} should not have a {1} tag", "{0.key}", "{1.key}"); }
Done.
/* should use building:levels instead building + levels */ *[building][levels] { throwWarning: tr("use building:levels instead {0}", "{1.key}"); fixChangeKey: "levels => building:levels"; }
Done.
/* they shouldn't have a "yes" or "true" value */ *[amenity?], *[place?] { throwWarning: tr("unspecific value for {0}", "{0.key}"); }
Done.
/* lanes* must be an integer positive number only */ way[highway][lanes][lanes !~ /^[1-9]([0-9]*)$/], way[highway]["lanes:backward"]["lanes:backward" !~ /^[1-9]([0-9]*)$/], way[highway]["lanes:forward"]["lanes:forward" !~ /^[1-9]([0-9]*)$/] { throwError: tr("{0} must be a positive integer number", "{1.key}"); }
Done.
/* destination rules http://wiki.openstreetmap.org/wiki/Key:destination */ /* destination is "Worthwile only if used in combination with oneway=yes" */ way[destination][!oneway?] { throwWarning: tr("incomplete usage of {0}", "{0.key}"); suggestAlternative: "destination:forward"; suggestAlternative: "destination:backward"; }
Done.
Note that those tests were created for data that we were seeing here in Brazil but they aren't specific for here.
Some warning messages probably need a better wording.
Anything that could be useful for JOSM?
Change History (23)
comment:1 by , 11 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 11 years ago
| Milestone: | → 14.12 |
|---|
comment:3 by , 11 years ago
comment:4 by , 11 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:6 by , 11 years ago
| Description: | modified (diff) |
|---|
comment:7 by , 11 years ago
/* lanes* must be an integer positive number only */ way[highway][lanes][lanes !~ /^[1-9]([0-9]*)$/], way[highway]["lanes:backward"]["lanes:backward" !~ /^[1-9]([0-9]*)$/], way[highway]["lanes:forward"]["lanes:forward" !~ /^[1-9]([0-9]*)$/] { throwError: tr("{0} must be a positive integer number", "{1.key}"); }
@team: is this fine in mapcss or better handled in a java validator test?
follow-up: 10 comment:8 by , 11 years ago
Hi, what about shop=yes ? I see it is used about 30000 times and has even a wiki page. But we could have an 'info' or 'warning' message about it. It seems discouraged to use it.
follow-up: 11 comment:9 by , 11 years ago
Should building:levels also be tested for positive integer numbers?
comment:10 by , 11 years ago
Replying to aceman:
Hi, what about shop=yes ? I see it is used about 30000 times and has even a wiki page. But we could have an 'info' or 'warning' message about it. It seems discouraged to use it.
It's often used at amenity=fuel. It's even in the default preset.
edit: but I agree, this is not optimal
comment:11 by , 11 years ago
Replying to naoliv:
Should
building:levelsalso be tested for positive integer numbers?
I think there can be half height storeys.
comment:13 by , 11 years ago
/* is using any other *_name tag but not a name */ *[/_name$/][!name] { throwWarning: tr("using alternative name without {0}", "{1.key}"); }
This test produces false positives for:
- old_name
- loc_name
- uic_name
comment:15 by , 11 years ago
comment:17 by , 11 years ago
Does feel to me like the right usage of old_name. Maybe disused:name=* would be better.
comment:19 by , 11 years ago
way/286295915 was part of the main street "Zschopauer Straße" before the trunk was built in the last years. Now it has become just a driveway without a name.
follow-up: 21 comment:20 by , 11 years ago
Since it's just a warning (and not an error), can't it be ignored by the user?
comment:21 by , 11 years ago
Replying to naoliv:
Since it's just a warning (and not an error), can't it be ignored by the user?
The most messages are warning level. And if there are too much false positives, people don't trust the validator and start ignoring the whole validator.
comment:23 by , 11 years ago
| Description: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |



This is already included. See [7697]