Opened 11 years ago
Closed 7 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?
- Have a closed way (id:0) with four nodes where three already have an id greater than zero and one is new (id:0).
- Draw a new, closed way with four nodes.
- 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)
Change History (8)
follow-up: 2 comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 7 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 , 7 years ago
Attachment: | 10225-v2.patch added |
---|
comment:3 by , 7 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 , 7 years ago
Summary: | Replace Geometry: Denies possible replacement with a wrong warning → [Patch] Replace Geometry: Denies possible replacement with a wrong warning |
---|
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?