#18455 closed enhancement (fixed)
Warn about main tag with incorrect object type (steps)
Reported by: | skyper | Owned by: | Don-vip |
---|---|---|---|
Priority: | normal | Milestone: | 20.01 |
Component: | Core validator | Version: | |
Keywords: | template_report object type presets | Cc: |
Description
What steps will reproduce the problem?
- have a closed way tagged with
highway=steps
(254486816) - run validator
What is the expected result?
A warning about an incorrect/unusual object type (closed way).
What happens instead?
No warning
Please provide any additional information below. Attach a screenshot if possible.
The object types are set correctly in presets as I get a warning using it and I have to manually add highway=steps
.
In general, it would be nice if you get a warning if presets do not allow the tag on the object type.
Thanks
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2019-12-21 15:53:55 +0100 (Sat, 21 Dec 2019) Revision:15607 Build-Date:2019-12-22 02:30:55 URL:https://josm.openstreetmap.de/svn/trunk Last errors/warnings: - W: No configuration settings found. Using hardcoded default values for all pools. - W: Region [TMS_BLOCK_v2] Resetting cache
Attachments (2)
Change History (31)
comment:1 by , 5 years ago
Keywords: | presets added |
---|---|
Milestone: | → 20.01 |
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 5 years ago
I think the error message "Wrong presets types" is missleading. Seems to say that the preset is wrong?
comment:8 by , 5 years ago
Replying to GerdP:
What do you think about "Type not in preset" ?
How about "Object type not in preset"
and "Object type {0} is not supported by tagging preset: {1}"
?
comment:10 by , 5 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:12 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:14 by , 5 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Thank too,
found a little problem with relations. (1970390)
Object type relation is not supported by tagging preset: General attributes (oneway) (1)
Object type relation is not supported by tagging preset: River (1)
follow-up: 16 comment:15 by , 5 years ago
Found one more one a building mapped as mulipolygon:
Object type multipolygon is not supported by tagging preset: Simple 3D buildings outline (1)
Maybe do not check all relations.
comment:16 by , 5 years ago
Replying to skyper:
Found one more one a building mapped as mulipolygon:
Object type multipolygon is not supported by tagging preset: Simple 3D buildings outline (1)
Forget this one. Its from an additional preset.
follow-up: 19 comment:18 by , 5 years ago
It seems this additional test requires a lot of CPU power. TagChecker takes much longer compared to r15628.
According to Java Mission Control the "hot" methods are
Stack Trace Sample Count Percentage(%) org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem.matches(Iterable, Map) 121 9,967 org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem.matches(Map) 70 5,766
comment:19 by , 5 years ago
Replying to GerdP:
It seems this additional test requires a lot of CPU power.
Yes, that was also one good reason to make it an INFO level. Do you see a possible optimization?
comment:20 by , 5 years ago
The test is executed even if info level is not selected. A simple improvement would be to check this first.
comment:23 by , 5 years ago
Maybe TaggingPresetItem.matches(Iterable<? extends TaggingPresetItem> data, Map<String, String> tags)
could be improved. Current loop iterates over all items. This is needed since the check item.matches(tags)
may return false for the last item. If the list of items could be sorted so that we can first check if a mandantory tag is missing we might save some iterations, esp. those for link, space etc..
by , 5 years ago
Attachment: | 18455-performance.patch added |
---|
POC: filter TaggingPreset.data
to avoid tests which never match. Reduces runtime from ~10 secs to ~2 secs with my test data.
comment:25 by , 5 years ago
This is the careful version which only adds the logic in TagChecker. I'd prefer to use the index in TaggingPresets
.
Would probably also improve reaction time when mouse moves over dialogs.
follow-up: 27 comment:26 by , 5 years ago
@Vincent: I tried to code this approach in TaggingPresets
but the performance improvement is much smaller compared to the solution in 18455-performance.patch as we would still iterate over many presets which never match.
Should I commit the patch?
In 15640/josm: