Opened 3 months ago
Last modified 3 months ago
#23852 new enhancement
Warn about width=0
Reported by: | Famlam | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core validator | Version: | |
Keywords: | template_report width | Cc: |
Description
What steps will reproduce the problem?
- Validate any of the 8516 ways with
width=0
What is the expected result?
A warning that width=0
is a very unlikely width of anything
What happens instead?
No warning
Please provide any additional information below. Attach a screenshot if possible.
There's 8516 ways with width=0
, of which 7452 in combination with highway
and 964 in combination with waterway
. It seems at least some of them were added due to an old bug of iD (and possibly the number grows due to ways getting split).
A width of 0 is physically impossible: an object cannot exist at 0 width (in a 3-dimensional world)
Possible rules to warn against these kind of cases:
way[width=0] { throwWarning: tr("unusual value of {0}", "{0.key}"); }
or, to include unit support:
way[width][siunit_length(tag("width")) = 0] { throwWarning: tr("unusual value of {0}", "{0.key}"); }
Revision:19160 Build-Date:2024-08-01 15:31:59 Identification: JOSM/1.5 (19160 nl) Windows 10 64-Bit OS Build number: Windows 10 Home 22H2 (19045) Memory Usage: 315 MB / 2012 MB (17 MB allocated, but free) Java version: 21.0.4+7-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 1920x1080x32bpp@60Hz (scaling 1.10×1.10) Maximum Screen Size: 1920×1080 Best cursor sizes: 16×16→32×32, 32×32→32×32 System property file.encoding: UTF-8 System property sun.jnu.encoding: Cp1252 Locale info: nl_NL Numbers with default locale: 1234567890 -> 1234567890 VM arguments: [-Djpackage.app-version=1.5.19160, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM.exe] Plugins: + OpeningHoursEditor (36258) + imagery_offset_db (36289) + measurement (36256) + pbf (36282) + pt_assistant (637) + reverter (36256) + tageditor (36298) + turnlanes-tagging (0.0.5) + undelete (36298) + utilsplugin2 (36298) Map paint styles: + https://josm.openstreetmap.de/josmfile?page=Styles/Potlatch2&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1 + %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.mappaint.mapcss + https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&zip=1 Validator rules: + %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.validator.mapcss + https://josm.openstreetmap.de/josmfile?page=Rules/SuspiciousSwimming_Pool&zip=1 + https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/TagFix_Destination.validator.mapcss + https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/Colour.validator.mapcss + https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/notprefix.validator.mapcss + https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/TagFix_MultipleTag2.validator.mapcss + https://raw.githubusercontent.com/Famlam/OsmMapcssValidationNL/main/netherlands.validator.mapcss Last errors/warnings: - 00001.310 W: extended font config - overriding 'filename.Malgun_Gothic=malgun.ttf' with 'MALGUN.TTF' - 00001.312 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF' - 00001.313 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF' - 00002.437 E: java.security.KeyStoreException: Windows-ROOT not found. Oorzaak: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
Attachments (0)
Change History (3)
comment:2 by , 3 months ago
I'm always afraid to touch height-related values, but yes, the others should be fine to add too if you wish (although some have very low occurrences). I just picked the one with a very large occurance and no questionable items.
P.s. for the list, maxaxleload
too
comment:3 by , 3 months ago
Yes, there is/was some cheating with height for 3D buildings but a value of 0
makes no sense.
Even with low occurrences it might make sense to add them as it might help users to prevent uploading data with these tags in first place.
Well, I would have expected that iD at least would have implemented a validation in responds to its bug.
Overall, most of the tags with numeric values could probably be checked against a value of
0
. You already mentionedlanes=*
butlength=*
(Key:length)maxlength[:*]=*
(Key:maxlength)maxheight[:physical]=*
(Key:maxheight)maxweight[:*]=*
(Key:maxweight)maxweightrating[:*]=*
(Key:maxweightrating)est_width=*
(Key:est_width)maxwidth[:physical]=*
(Key:maxwidth)come to my mind and probably even
depth=*
(Key:depth)height=*
(Key:height)est_height=*
(Key:est_height)min_height=*
(Key:min_height)maxspeed=*
(Key:maxspeed)