Modify

Opened 15 years ago

Closed 15 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)

validator.patch.gz (2.1 KB ) - added by delta_foxtrot2 15 years ago.
validator.patch.gz
validator2.patch.gz (1.1 KB ) - added by delta_foxtrot2 15 years ago.
validator2.patch.gz
ignoretags1.patch.gz (860 bytes ) - added by delta_foxtrot2 15 years ago.
ignoretags1.patch.gz
validator3.patch (1016 bytes ) - added by delta_foxtrot2 15 years ago.
validator3.patch
ignoretags2.patch (3.2 KB ) - added by delta_foxtrot2 15 years ago.
ignoretags2.patch
validator2.patch (4.3 KB ) - added by delta_foxtrot2 15 years ago.
validator2.patch
ignoretags3.patch (2.3 KB ) - added by delta_foxtrot2 15 years ago.
found some more tags that shouldn't throw a warning.

Download all attachments as: .zip

Change History (33)

comment:1 by stoecker, 15 years ago

Component: Core validatorInternal preset
Owner: changed from team to ce

Some of them will not be copied to presets. This warning will always exist. But some of them probably should be added to presets.

comment:2 by delta_foxtrot2, 15 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.

comment:3 by ce, 15 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 delta_foxtrot2, 15 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.

in reply to:  3 comment:5 by delta_foxtrot2, 15 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 delta_foxtrot2, 15 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 delta_foxtrot2, 15 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 delta_foxtrot2, 15 years ago

Cc: delta_foxtrot@… added
Component: Internal presetCore validator
Owner: changed from ce to team

comment:9 by delta_foxtrot2, 15 years ago

I created ticket #2807 to deal with the missing presets, and I reverted this ticket to be about the validator plugin

by delta_foxtrot2, 15 years ago

Attachment: validator.patch.gz added

validator.patch.gz

comment:10 by delta_foxtrot2, 15 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 stoecker, 15 years ago

Resolution: fixed
Status: newclosed

Please no tabs stops and proper indentation.

comment:12 by delta_foxtrot2, 15 years ago

Resolution: fixed
Status: closedreopened

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.

by delta_foxtrot2, 15 years ago

Attachment: validator2.patch.gz added

validator2.patch.gz

comment:13 by delta_foxtrot2, 15 years ago

Hopefully this patch better matches your coding policies.

Also this patch includes complex matching for tags not in prefixes.

comment:14 by delta_foxtrot2, 15 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 delta_foxtrot2, 15 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:16 by stoecker, 15 years ago

Creating a patch is perferred.

comment:17 by delta_foxtrot2, 15 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.

by delta_foxtrot2, 15 years ago

Attachment: ignoretags1.patch.gz added

ignoretags1.patch.gz

comment:18 by delta_foxtrot2, 15 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:19 by stoecker, 15 years ago

Resolution: fixed
Status: reopenedclosed

In [o16346].

by delta_foxtrot2, 15 years ago

Attachment: validator3.patch added

validator3.patch

comment:20 by delta_foxtrot2, 15 years ago

Ignore this patch, I attached it to the wrong bug, sorry.

by delta_foxtrot2, 15 years ago

Attachment: ignoretags2.patch added

ignoretags2.patch

comment:21 by delta_foxtrot2, 15 years ago

Resolution: fixed
Status: closedreopened

More tags that shouldn't throw warnings.

comment:22 by delta_foxtrot2, 15 years ago

previously this bug was closed, but validator2.patch wasn't applied

by delta_foxtrot2, 15 years ago

Attachment: validator2.patch added

validator2.patch

comment:23 by delta_foxtrot2, 15 years ago

reattached patch uncompressed and with correct path

comment:24 by stoecker, 15 years ago

Resolution: fixed
Status: reopenedclosed

In [o16436].

by delta_foxtrot2, 15 years ago

Attachment: ignoretags3.patch added

found some more tags that shouldn't throw a warning.

comment:25 by delta_foxtrot2, 15 years ago

Resolution: fixed
Status: closedreopened

thanks for applying my patches, however I've found some more tags that I think shouldn't throw warnings.

comment:26 by stoecker, 15 years ago

Resolution: fixed
Status: reopenedclosed

In [o16967].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.