- Timestamp:
- 2020-02-19T11:01:46+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r15886 r15887 699 699 List<AssembledPolygon> boundaries = findBoundaryPolygons(preparedWays, discardedWays); 700 700 701 // see #9599 702 if (discardedWays.stream().anyMatch(w -> !w.isNew())) { 703 for (int i = 0; i < boundaries.size(); i++) { 704 AssembledPolygon ring = boundaries.get(i); 705 for (int k = 0; k < ring.ways.size(); k++) { 706 WayInPolygon ringWay = ring.ways.get(k); 707 Way older = keepOlder(ringWay.way, oldestWayMap, discardedWays); 708 709 if (ringWay.way != older) { 710 WayInPolygon repl = new WayInPolygon(older, ringWay.insideToTheRight); 711 ring.ways.set(k, repl); 712 } 713 } 714 } 715 commitCommands(marktr("Keep older versions")); 716 } 717 701 718 //find polygons 702 719 List<AssembledMultipolygon> preparedPolygons = findPolygons(boundaries); … … 731 748 732 749 commitCommands(marktr("Delete relations")); 733 734 // see #9599: result should contain original way(s) where possible735 if (discardedWays.stream().anyMatch(w -> !w.isNew())) {736 for (int i = 0; i < polygons.size(); i++) {737 Multipolygon mp = polygons.get(i);738 for (int k = 0; k < mp.getInnerWays().size(); k++) {739 Way inner = mp.getInnerWays().get(k);740 Way older = keepOlder(inner, oldestWayMap, discardedWays);741 if (inner != older) {742 mp.getInnerWays().set(k, older);743 }744 }745 Way older = keepOlder(mp.outerWay, oldestWayMap, discardedWays);746 if (older != mp.outerWay) {747 Multipolygon mpNew = new Multipolygon(older);748 mpNew.innerWays.addAll(mp.getInnerWays());749 polygons.set(i, mpNew);750 }751 }752 commitCommands(marktr("Keep older versions"));753 }754 750 755 751 // Delete the discarded inner ways … … 795 791 copy.setNodes(way.getNodes()); 796 792 cmds.add(new ChangeCommand(oldest, copy)); 797 return copy;793 return oldest; 798 794 } 799 795 return way;
Note:
See TracChangeset
for help on using the changeset viewer.