Opened 7 years ago
Closed 7 years ago
#15719 closed enhancement (fixed)
provide autofix for replacing single comma by point for several numeric tags
Reported by: | mkoniecz | Owned by: | Klumbumbus |
---|---|---|---|
Priority: | normal | Milestone: | 18.01 |
Component: | Core validator | Version: | |
Keywords: | template_report comma decimal separator | Cc: | Klumbumbus |
Description
What steps will reproduce the problem?
- create object with height=1,7 tag
- validate it
What is the expected result?
"height: meters is default; period is separator; if units, put space then unit (1)" is reported, autofix button is available
What happens instead?
autofix button is not available, one needs to fix this manually
Please provide any additional information below. Attach a screenshot if possible.
I think that for situation where height field matches pattern \d,\d (number followed by comma followed by number) can be without doubt changed into number followed by dot followed by number.
More extravagant height values probably should stay without autofix field.
On of examples in the wild: https://www.openstreetmap.org/way/536961810
URL:http://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2017-12-31 03:09:43 +0100 (Sun, 31 Dec 2017) Build-Date:2017-12-31 02:33:46 Revision:13265 Relative:URL: ^/trunk Identification: JOSM/1.5 (13265 en) Linux Ubuntu 16.04.3 LTS Memory Usage: 537 MB / 871 MB (207 MB allocated, but free) Java version: 1.8.0_151-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Screen: :0.0 1920x1080 Maximum Screen Size: 1920x1080 Dataset consistency test: No problems found Plugins: + OpeningHoursEditor (33876) + buildings_tools (33735) + continuosDownload (68) + imagery_offset_db (33774) + reverter (33865) + todo (30303) Last errors/warnings: - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet - W: java.io.IOException: Attribution is not loaded yet
Attachments (0)
Change History (13)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Cc: | added |
---|---|
Milestone: | → 18.01 |
It should work, can you please check:
fixAdd: concat("height=", trim(replace(tag("height"), ",", ".")));
follow-up: 4 comment:3 by , 7 years ago
yes, the question is if #15726 will be fixed first, which may influence the creation of the rules for this ticket.
comment:4 by , 7 years ago
Keywords: | comma decimal separator added |
---|---|
Summary: | provide autofix for replacing single coma by period for height field → provide autofix for replacing single comma by period for height field |
Replying to Klumbumbus:
the question is if #15726 will be fixed first
Probably not. It's very tricky to fix as the tag
function is called by the MapCSS engine before the validator replaces the parameters. I currently have no idea how we could fix it.
By the way: I think "period" is not correct English and we should say "point" instead.
comment:7 by , 7 years ago
Summary: | provide autofix for replacing single comma by period for height field → provide autofix for replacing single comma by point for several numeric tags |
---|
follow-up: 11 comment:10 by , 7 years ago
I just noticed that there is a number of objects where ,
is used as thousands separator, e.g. https://www.openstreetmap.org/node/3015674189 or https://www.openstreetmap.org/relation/2928801
So it seems the autofix especially for ele and distance is not save.
I think we should restrict the autofix to values with max. 2 digits after the comma. Any other thoughts?
comment:11 by , 7 years ago
Replying to Klumbumbus:
I think we should restrict the autofix to values with max. 2 digits after the comma. Any other thoughts?
and remove it for three digits?
comment:12 by , 7 years ago
I would rather just display the warning and let the user manually fix it.
Makes sense.
We have 1229 objects with a comma in
height
https://overpass-turbo.eu/s/uac4760 objects with a comma in
width
https://overpass-turbo.eu/s/uad1393 objects with a comma in
ele
https://overpass-turbo.eu/s/uae2444 objects with a comma in
distance
https://overpass-turbo.eu/s/uaf