Modify

Opened 10 years ago

Closed 5 years ago

#10225 closed defect (fixed)

[Patch] Replace Geometry: Denies possible replacement with a wrong warning

Reported by: skyper Owned by: team
Priority: normal Milestone:
Component: Plugin utilsplugin2 Version:
Keywords: replace geometry Cc: Zverikk

Description

What steps will reproduce the problem?

  1. Have a closed way (id:0) with four nodes where three already have an id greater than zero and one is new (id:0).
  2. Draw a new, closed way with four nodes.
  3. Replace Geometry

What is the expected result?

The older way is replaced by the new one and all three node ids are reused.

What happens instead?

Warning: Please select one way that exists in the database and one new way with correct geometry"

Please provide any additional information below. Attach a screenshot if possible.

If I delete the new node from the first way the action performs fine.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2014-07-03 01:36:33
Last Changed Author: Don-vip
Revision: 7283
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2014-07-02 20:36:46 +0200 (Wed, 02 Jul 2014)
Last Changed Rev: 7283

Identification: JOSM/1.5 (7283 en) Linux Debian GNU/Linux 7.5 (wheezy)
Memory Usage: 547 MB / 882 MB (268 MB allocated, but free)
Java version: 1.7.0_55, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-7-jre:amd64-7u55-2.4.7-1~deb7u1
Dataset consistency test: No problems found

Plugin: OpeningHoursEditor (30416)
Plugin: conflation (0.1.7)
Plugin: imagery-xml-bounds (30495)
Plugin: jts (30416)
Plugin: mirrored_download (30495)
Plugin: notes (v0.9.2)
Plugin: photoadjust (30428)
Plugin: reverter (30436)
Plugin: terracer (30416)
Plugin: todo (29154)
Plugin: undelete (30416)
Plugin: utilsplugin2 (30460)
Plugin: wikipedia (30449)

Attachments (3)

10225.patch (1.6 KB ) - added by GerdP 5 years ago.
Possible solution
10225-v2.patch (6.5 KB ) - added by GerdP 5 years ago.
10225_test.osm.bz2 (97.2 KB ) - added by GerdP 5 years ago.
sample data, search for "type:way new"

Download all attachments as: .zip

Change History (8)

comment:1 by simon04, 9 years ago

Cc: Zverikk added

For unclear cases (also two new ways being selected) we could show a dialog similar to ticket:10730#comment:4 (split way action). Any thoughts?

by GerdP, 5 years ago

Attachment: 10225.patch added

Possible solution

in reply to:  1 comment:2 by GerdP, 5 years ago

Sorry, while writing this comment I found out that the attached patch will probably not always work.
Replying to simon04:

For unclear cases (also two new ways being selected) we could show a dialog similar to ticket:10730#comment:4 (split way action). Any thoughts?

Yes, such a dilaog would help, but we might display two ways with id 0 unless the user has configured JOSM to show negative ids.
I think in some cases it is possible to compute the right way if both are new, working on it again.

by GerdP, 5 years ago

Attachment: 10225-v2.patch added

by GerdP, 5 years ago

Attachment: 10225_test.osm.bz2 added

sample data, search for "type:way new"

comment:3 by GerdP, 5 years ago

The new patch fixes the problem. I've created a another example similar to the one described above where existing code fails. This one also adds a new (shared) node to both ways. The patched version also works with this case.
For now I've only changed the message to "Both ways are new and have new nodes, cannot decide which one has the correct geometry."
The patch also improves javadoc and simplifies a try/catch block.

Please suggest a better message, else I'll commit this tomorrow.

comment:4 by GerdP, 5 years ago

Summary: Replace Geometry: Denies possible replacement with a wrong warning[Patch] Replace Geometry: Denies possible replacement with a wrong warning

comment:5 by GerdP, 5 years ago

Resolution: fixed
Status: newclosed

fixed with [o34844:34845]

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