#9470 closed enhancement (fixed)
[Patch] "layer tag with + sign" should be autofixable
Reported by: | mkoniecz | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 14.01 |
Component: | Core validator | Version: | |
Keywords: | Cc: |
Description
It is always wrong, trivial to fix, therefore fix button should work for this one.
example: osmwww:browse/node/1778571005
example: osmwww:browse/node/1674911274
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2013-12-25 02:35:41 Last Changed Author: Don-vip Revision: 6527 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2013-12-25 01:28:44 +0100 (Wed, 25 Dec 2013) Last Changed Rev: 6527 Identification: JOSM/1.5 (6527 en_GB) Windows 7 32-Bit Memory Usage: 247 MB / 247 MB (77 MB allocated, but free) Java version: 1.7.0_45, Oracle Corporation, Java HotSpot(TM) Client VM Dataset consistency test: No problems found Plugin: OpeningHoursEditor (30117) Plugin: buildings_tools (30057) Plugin: notes (v0.8)
Attachments (1)
Change History (14)
comment:1 by , 11 years ago
Type: | defect → enhancement |
---|
follow-up: 6 comment:3 by , 11 years ago
That is possible since Help/Styles/MapCSSImplementation provides several functions that can be executed on a matched primitive. I attached (a quite complicated) patch, which evaluates those functions for any fixAdd
/fixRemove
.
Future idea: Also, it would be interesting to have the "{0} without {1}"
messages automatically filled with the tags corresponding to the match.
by , 11 years ago
Attachment: | 9470.patch added |
---|
comment:4 by , 11 years ago
Summary: | "layer tag with + sign" should be autofixable → [Patch] "layer tag with + sign" should be autofixable |
---|
follow-up: 7 comment:5 by , 11 years ago
Are you sure the patch works if '+' is not the first character ?
With this approach I fear we "fix" values like "0;+1" by ";+1"
Can't we just implement a "replace" function ? something like replace("+","")
comment:6 by , 11 years ago
Replying to simon04:
it would be interesting to have the
"{0} without {1}"
messages automatically filled with the tags corresponding to the match.
Excellent idea :)
comment:7 by , 11 years ago
Replying to Don-vip:
Are you sure the patch works if '+' is not the first character ?
With this approach I fear we "fix" values like "0;+1" by ";+1"
Right. I first played with a case where only a prefixes of +
get detected.
Can't we just implement a "replace" function ? something like replace("+","")
Sure; that is even easier than substring
(since the latter involved nasty debugging of index 1
being parsed as float w/ no implemented conversion to int
).
What is your feeling on the complexity increase for this feature in general?
comment:8 by , 11 years ago
I think the replace() approach is ok for now. We'll see later if we can do something easier for people to define their own MapCSS rules and give us nice patches :D
comment:12 by , 11 years ago
Milestone: | → 14.01 |
---|
It is not so trivial to implement, until very recently we had no way to fix errors detected in tagchecker. We have now the new MapCSS-based version of tagchecker, but I don't know if we can modify only a part of a given value.