Opened 16 years ago
Closed 16 years ago
#2803 closed defect (fixed)
[PATCH] False positives being flagged
Reported by: | delta_foxtrot2 | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core validator | Version: | |
Keywords: | Cc: | delta_foxtrot@… |
Description
I get the following false positives coming up, which are deemed valid on the following URL:
http://wiki.openstreetmap.org/wiki/Map_Features
I'd be happy to try and fix these false positives but it seems to download lists from SVN. The false positives I'm getting so far are:
- Value 'secondary_link' for key 'highway' not in presets
- Value 'wood' for key 'surface' not in presets
- Value 'mall' for key 'shop' not in presets
- Value 'dirt' for key 'surface' not in presets
I also get a bunch of 'Presets do not contain property key' warnings for the following:
- Key 'au.gov.abs:*' not in presets
- Key 'construction' not in presets
- Key 'loc_name' not in presets
- Key 'is_in:country_code' not in presets
- Key 'is_in:state' not in presets
- Key 'attribution' not in presets
- Key 'is_in:country' not in presets
- Key 'is_in:state' not in presets
- Key 'admin_level' not in presets
- Key 'old_name' not in presets
- Key 'usage' not in presets
I'm sure there are others, but that's what I get for the area covering Gympie, QLD, Australia
Attachments (7)
Change History (33)
comment:1 by , 16 years ago
Component: | Core validator → Internal preset |
---|---|
Owner: | changed from | to
comment:2 by , 16 years ago
The problem with them not being in presets is it tends to confuse people, a number of the tags I listed have been bulk imported and people shouldn't mess with them and all the false positives leads to the preset warnings being less useful since real warnings are drowned out and people will ignore everything rather than things that shouldn't be warnings.
follow-up: 5 comment:3 by , 16 years ago
I can imagine the tags highway=secondary_link, shop=mall and surface=dirt to be added. However surface=wood is not listed in Map Features. As we already have natural=wood and landuse=forest, I do no see much sense in adding it.
comment:4 by , 16 years ago
I'm starting to figure all this out in my head, this seems like 2 issues almost, the first is missing presets, the second is tags that shouldn't generate warnings.
For the missing presets that should appear they just need to be added, but there seems to be a need for a list of tags that shouldn't be presets but shouldn't throw up errors either, like the au.gov.abs tags.
I'll see if I can hack something together for the latter, the former should be easy enough for almost anyone to do.
comment:5 by , 16 years ago
Replying to christeck:
However surface=wood is not listed in Map Features.
I'm not sure what you're looking at but the following surfaces are listed as valid, including wood:
paved / unpaved / asphalt / concrete / paving_stones / cobblestone / metal / wood / grass_paver / gravel / pebblestone / grass / ground / earth / dirt / mud / sand / ice_road
In terms of surface=wood it's a wooden bridge, so the surface literally is made of wood, not a wooded area.
comment:6 by , 16 years ago
Re-checking the code in the validator plugin there is already some values being ignored that aren't in the prefix list:
On line 394 of TagChecker.java:
Arrays.asList(new String[]{"opengeodb","openGeoDB","name:","note:"})))
I just extended this to include ABS tags:
Arrays.asList(new String[]{"opengeodb","openGeoDB","name:","note:","au.gov.abs:"})))
If you take into account other tags like 'qroti:' which adds a URI and other tags and links to this site:
http://qroti.com/cgi/placeinfo.pl?ID=9007
the list could get quite long and probably needs to have code to download a cfg file similar to other config files that are downloaded for spell check and tag check purposes.
comment:7 by , 16 years ago
Temporary hack that works for invalid key errors that should be ignored:
for(String a : Main.pref.getCollection(PreferenceEditor.PREFIX + ".startswithkeys", Arrays.asList(new String[]{"opengeodb","openGeoDB","name:","note:","au.gov.abs:","qroti:","is_in:"}))) { if(key.startsWith(a)) ignore = true; } for(String a : Main.pref.getCollection(PreferenceEditor.PREFIX + ".equalskeys", Arrays.asList(new String[]{"loc_name","attribution","admin_level","old_name","usage","construction"}))) { if(key.equals(a)) ignore = true; }
I didn't attempt to fix shop=mall as that should be dealt with elsewhere.
comment:8 by , 16 years ago
Cc: | added |
---|---|
Component: | Internal preset → Core validator |
Owner: | changed from | to
comment:9 by , 16 years ago
I created ticket #2807 to deal with the missing presets, and I reverted this ticket to be about the validator plugin
comment:10 by , 16 years ago
Summary: | False positives being flagged → [PATCH] False positives being flagged |
---|
The patch I just uploaded is a quick and dirty hack to add an additional .cfg file into the mix that gives the validator plugin the ability to know about valid tags, even if they aren't presets.
comment:11 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Please no tabs stops and proper indentation.
comment:12 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Sorry about tabs, coding habits die hard. I've reopened this bug simply to save from filing a new bug on the same issue.
As for the patch, I have some new code to cover the situation of religion and more specifically denomination.
if religion=christian, denomination can't equal sunni for example, because that's a denomination of muslim.
or if religion is specified, but no denomination that's probably cause for a warning also.
I'll clean up the code and post a new patch diffed from any new code added to svn.
comment:13 by , 16 years ago
Hopefully this patch better matches your coding policies.
Also this patch includes complex matching for tags not in prefixes.
comment:14 by , 16 years ago
Also I seemed to have left these out of the ignoretags.cfg by accident:
T:religion=christian|denomination=anglican
T:religion=christian|denomination=apostolic
T:religion=christian|denomination=baptist
Pretty sure everything else was included properly.
comment:15 by , 16 years ago
More tags:
I already added S:is_in: but it probably should just be S:is_in as these are still generating false positive warnings.
I also found cycleway=track is tripping things, so K:cycleway=track should be added to the list.
Also as I come across these errors would you prefer that I keep adding them here or create a patch or some other method?
comment:17 by , 16 years ago
I'm searching for "missing" tags so to speak and just came across a lot of tags missing, patch has already been attached.
comment:18 by , 16 years ago
Latest ignore patch has all the tags I've found to date I think should be ignored. I don't expect to find anything else for the time being.
comment:21 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
More tags that shouldn't throw warnings.
by , 16 years ago
Attachment: | ignoretags3.patch added |
---|
found some more tags that shouldn't throw a warning.
comment:25 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
thanks for applying my patches, however I've found some more tags that I think shouldn't throw warnings.
Some of them will not be copied to presets. This warning will always exist. But some of them probably should be added to presets.