Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 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 8 years ago.
PATCH
plugin.diff (3.0 KB ) - added by Tyndare 8 years ago.
[PATCH] for plugins
applyAutomaticTagConflictResolution-updated.diff (21.1 KB ) - added by Tyndare 8 years ago.
PATCH (updated)
TagConflictResolutionUtilTest.java (18.9 KB ) - added by Tyndare 8 years ago.
Unit test
canvec.png (84.5 KB ) - added by Don-vip 8 years ago.
cadastre.png (168.6 KB ) - added by Don-vip 8 years ago.

Download all attachments as: .zip

Change History (17)

by Tyndare, 8 years ago

PATCH

by Tyndare, 8 years ago

Attachment: plugin.diff added

[PATCH] for plugins

comment:1 by Don-vip, 8 years ago

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

by Tyndare, 8 years ago

PATCH (updated)

comment:2 by Tyndare, 8 years ago

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

applyAutomaticTagConflictResolution-updated.diff

by Tyndare, 8 years ago

Unit test

comment:3 by Don-vip, 8 years ago

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 by Don-vip, 8 years ago

Keywords: canada import added

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

comment:5 by Don-vip, 8 years ago

Priority: normalmajor

by Don-vip, 8 years ago

Attachment: canvec.png added

by Don-vip, 8 years ago

Attachment: cadastre.png added

comment:6 by Don-vip, 8 years ago

Values concerned by this ticket:



comment:7 by Don-vip, 8 years ago

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

comment:8 by Don-vip, 8 years ago

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 by Don-vip, 8 years ago

In 11607/josm:

see #14374 - remove TigerUtils class, not used anymore

comment:10 by Klumbumbus, 8 years ago

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

comment:11 by Don-vip, 8 years ago

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. 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.