Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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)

9470.patch (8.9 KB) - added by simon04 6 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 6 years ago by Don-vip

Type: defectenhancement

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.

comment:2 Changed 6 years ago by Don-vip

In 6532/josm:

fix #8687, see #9414, see #9470 - tagchecker: update numeric tests to new MapCSS format, with embedded unit tests. MapCSS syntax updated a bit for regex.

comment:3 Changed 6 years ago by simon04

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.

Changed 6 years ago by simon04

Attachment: 9470.patch added

comment:4 Changed 6 years ago by simon04

Summary: "layer tag with + sign" should be autofixable[Patch] "layer tag with + sign" should be autofixable

comment:5 Changed 6 years ago by 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"

Can't we just implement a "replace" function ? something like replace("+","")

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

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 in reply to:  5 Changed 6 years ago by simon04

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 Changed 6 years ago by Don-vip

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:9 Changed 6 years ago by simon04

Resolution: fixed
Status: newclosed

In 6534/josm:

fix #9470 see #9414 - make "layer tag with + sign" auto fixable

comment:10 Changed 6 years ago by Don-vip

Nice ! and not so trivial :)

comment:11 Changed 6 years ago by simon04

In 6535/josm:

fix #9475 see #9470 - NPE on startup - java.lang.reflect.InvocationTargetException

comment:12 Changed 6 years ago by Don-vip

Milestone: 14.01

comment:13 Changed 6 years ago by Don-vip

Ticket #9293 has been marked as a duplicate of this ticket.

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.