Modify

Opened 6 years ago

Closed 6 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?

  1. create object with height=1,7 tag
  2. 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 naoliv, 6 years ago

Makes sense.

We have 1229 objects with a comma in height https://overpass-turbo.eu/s/uac
4760 objects with a comma in width https://overpass-turbo.eu/s/uad
1393 objects with a comma in ele https://overpass-turbo.eu/s/uae
2444 objects with a comma in distance https://overpass-turbo.eu/s/uaf

comment:2 by Don-vip, 6 years ago

Cc: Klumbumbus added
Milestone: 18.01

It should work, can you please check:

fixAdd: concat("height=", trim(replace(tag("height"), ",", ".")));

comment:3 by Klumbumbus, 6 years ago

yes, the question is if #15726 will be fixed first, which may influence the creation of the rules for this ticket.

in reply to:  3 comment:4 by Don-vip, 6 years ago

Keywords: comma decimal separator added
Summary: provide autofix for replacing single coma by period for height fieldprovide 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:5 by Klumbumbus, 6 years ago

Owner: changed from team to Klumbumbus

OK.

comment:6 by Klumbumbus, 6 years ago

In 13343/josm:

see #15719 - improve/unify validator messages

comment:7 by Klumbumbus, 6 years ago

Summary: provide autofix for replacing single comma by period for height fieldprovide autofix for replacing single comma by point for several numeric tags

comment:8 by Klumbumbus, 6 years ago

In 13345/josm:

see #15719 - provide autofix for replacing single comma by point for several numeric tags

comment:9 by Klumbumbus, 6 years ago

In 13349/josm:

see #15719 - allow units in width comma autofix

comment:10 by Klumbumbus, 6 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 toughts?

Version 0, edited 6 years ago by Klumbumbus (next)

in reply to:  10 comment:11 by Don-vip, 6 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 Klumbumbus, 6 years ago

I would rather just display the warning and let the user manually fix it.

comment:13 by Klumbumbus, 6 years ago

Resolution: fixed
Status: newclosed

In 13357/josm:

fix #15719 - restrict comma autofix to max. 2 decimal places to avoid false fixes of thousands separators

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Klumbumbus.
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.