Is there any way of writing my own custom rules for the JOSM validator, or to change some of the existing rules? Sometimes, the default rules flag as "warning" lots of "defects" that really aren't problems, because the underlying rule is not specific enough, or is too strict, and sometimes I want new rules so that I can check my own work more strictly. For example, the default rules flag the ways used for house number interpolation that end near a street corner as "Way end near other way", and while this is strictly true, these ways do not have real physical representation, and are just a helpful construct to aid in address geolocation. Therefore, I do not want them flagged as such, requiring one extra rule in the validation to exclude them. See this question for more information. If I disable the "unconnected ways" option in the preferences page, or change the "validator.UnconnectedWays.node_way_distance" configuration value, the validator will miss the real unconnected ways... Another example is for the recent change that flags as "warning" the missing voltage of power lines. See here. I do want to disable this rule (annoying!) in my local working copy, but if I disable the "power lines" option in the JOSM validator's preferences page, I would also disable all of the other errors/warnings related to power lines. asked 18 Nov '13, 20:08 MCPicoli |
As far as I know there isn't an "easy syntax" to create/modify validator tests (like there is for presets for example). You'll have to patch this code to modify an existing test or add a new one. Your example improvement of ignoring certain ways for the unconnected_ways test shouldn't be hard to do. Once you've improved a validator test, upstream will certainly be happy to review and merge your patch, so that all users can benefit. Create a josm bug report explaining why the change is needed and attaching your patch. Thanks in advance :) answered 19 Nov '13, 10:03 Vincent de P... ♦ If you aren't comfortable with software development workflows (downloading, compiling, comitting...) head over to #osm-dev or #josm to guide you. Have fun :)
(19 Nov '13, 10:07)
Vincent de P... ♦
Seems easy enough. I'll give it a try next weekend, work hours allowing.
(19 Nov '13, 11:39)
MCPicoli
4
WOW! Was just checking the code Vincent linked (hoping to understand it), and, to my surprise, there already was a patch (by Don-vip) for this case (for the bug report I opened yesterday)! Probably it'll be merged into the next "tested" version. Thanks anyway!
(19 Nov '13, 11:44)
MCPicoli
|
Hello, would anyone be able to create a .mapcss file for validator to reveal the address (as a duplication) placed on the building as a node? (if any address tag already exists in the building) answered 19 Feb, 07:01 Klerik7 |
With JOSM’s tag checker it’s now possible to add your own custom validations using MapCSS. For example:
When you run the validator (typically automatically before upload) you’ll get a warning: answered 19 Apr '22, 22:07 Andrew Kvalheim |