Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#14374 closed enhancement (fixed)

[PATCH] TagConflictResolutionUtil : automatic tag conflict resolution

Reported by: Tyndare Owned by: Don-vip
Priority: major Milestone: 17.02
Component: Core Version:
Keywords: tag conflict resolution tiger cadastre france canada import Cc:

Description

Hi,

I'm trying to see how to update buildings data in France that has been imported from the "cadastre".
We have the authorization to import data from the French cadastre if the "source" tag mention the year.
This lead to tag conflicts whenever we try to merge or update building geometry, as the year of newly imported data is different.

I think this particular conflict should be resolved automatically, by choosing the source tag with the most recent year.

I looked at the class TagConflictResolutionUtil.java
and there was already an automatic resolution implemented for "tiger:*" tags in the US.

I imagine TIGER or French cadastre are not the only conflict cases that could be automated so I tried to make something a little generic.

I defined two kinds of automatic resolution preference:

  • automatic-tag-conflict-resolution.combine: where the values are automatically combined with a separator, like it was done for Tiger.
  • automatic-tag-conflict-resolution.choice: where the best value from a group is automatically selected.

I'm not used to JOSM code, so don't hesitate to tell me if my code is not structured correctly.

It's not visible in the patch but I also deleted the file
TigerUtils.java
which is no longer necessary.

If this patch is accepted I may try to make also a preference editor dialogue to allow users to add new entries.

Regards,

Tyndare.

Attachments (6)

applyAutomaticTagConflictResolution.diff (14.6 KB) - added by Tyndare 2 years ago.
PATCH
plugin.diff (3.0 KB) - added by Tyndare 2 years ago.
[PATCH] for plugins
applyAutomaticTagConflictResolution-updated.diff (21.1 KB) - added by Tyndare 2 years ago.
PATCH (updated)
TagConflictResolutionUtilTest.java (18.9 KB) - added by Tyndare 2 years ago.
Unit test
canvec.png (84.5 KB) - added by Don-vip 2 years ago.
cadastre.png (168.6 KB) - added by Don-vip 2 years ago.

Download all attachments as: .zip

Change History (17)

Changed 2 years ago by Tyndare

PATCH

Changed 2 years ago by Tyndare

Attachment: plugin.diff added

[PATCH] for plugins

comment:1 Changed 2 years ago by Don-vip

This looks great! Some remarks:
1) Are you used to JUnit tests? This would be useful to add unit tests for this new feature.
2) All public/protected methods should have Javadoc
3) Please don't add labels such as keyLoop:
4) You can enable Checkstyle in your IDE to meet code rules (whitespaces, etc.)

Changed 2 years ago by Tyndare

PATCH (updated)

comment:2 Changed 2 years ago by Tyndare

Thanks a lot for your feedback and valuables comments.
Please find attached an updated version which includes the modifications you suggested:

applyAutomaticTagConflictResolution-updated.diff

Changed 2 years ago by Tyndare

Unit test

comment:3 Changed 2 years ago by Don-vip

Keywords: france added
Milestone: 17.02
Owner: changed from team to Don-vip
Status: newassigned

This looks very nice, I'll give it a try soon :)

comment:4 Changed 2 years ago by Don-vip

Keywords: canada import added

The patch is awesome. I'm adding CanVec too :)

comment:5 Changed 2 years ago by Don-vip

Priority: normalmajor

Changed 2 years ago by Don-vip

Attachment: canvec.png added

Changed 2 years ago by Don-vip

Attachment: cadastre.png added

comment:6 Changed 2 years ago by Don-vip

Values concerned by this ticket:



comment:7 Changed 2 years ago by Don-vip

2010 was a mess, 5 different formats... I'm reworking the regex to match all existing values.

comment:8 Changed 2 years ago by Don-vip

Resolution: fixed
Status: assignedclosed

In 11606/josm:

fix #14374 - automatic tag conflict resolution of source for French cadastre and Canadian CanVec (patch from Tyndare, modified)

comment:9 Changed 2 years ago by Don-vip

In 11607/josm:

see #14374 - remove TigerUtils class, not used anymore

comment:10 Changed 2 years ago by Klumbumbus

Someone please also add a short end user documentation about the new features at Help/Concepts/Conflict or Help/Dialog/Conflict

comment:11 Changed 2 years ago by Don-vip

In 11614/josm:

see #14374 - sonar - pmd-unit-tests:UseAssertSameInsteadOfAssertTrue - Use assertSame instead of assertTrue

Modify Ticket

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