Changeset 3383 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-07-24T19:15:45+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r3230 r3383 186 186 int i = 0; 187 187 if(checkForTagConflicts(a, b)) return true; // User aborted, so don't warn again 188 if(joinAreas(a, a)) 188 if(joinAreas(a, a)) { 189 189 ++i; 190 if(joinAreas(b, b)) 190 } 191 if(joinAreas(b, b)) { 191 192 ++i; 193 } 192 194 hadChanges = i > 0; 193 195 cmdsCount = i; … … 215 217 // Join outer ways 216 218 Way outerWay = joinOuterWays(allWays, innerWays); 219 if (outerWay == null) 220 return true; 217 221 218 222 // Fix Multipolygons if there are any … … 605 609 606 610 commitCommands(marktr("Join Areas: Remove Short Ways")); 607 return closeWay(joinWays(join)); 611 Way joinedWay = joinWays(join); 612 if (joinedWay != null) 613 return closeWay(joinedWay); 614 else 615 return null; 608 616 } 609 617 … … 648 656 a = b; 649 657 } 650 if((a = new CombineWayAction().combineWays(ways)) != null) 658 if((a = new CombineWayAction().combineWays(ways)) != null) { 651 659 cmdsCount++; 660 } 652 661 return a; 653 662 } … … 676 685 for(Node n : w.getNodes()) { 677 686 if(outerNodes.contains(n)) { 678 if(!selfintersect) // allow outer point for self intersection687 if(!selfintersect) { // allow outer point for self intersection 679 688 continue wayIterator; 689 } 680 690 } 681 691 else if(!hasInnerNodes && innerNodes.contains(n)) { … … 715 725 int i = 0; 716 726 // w2 cannot be closed, otherwise it would have been removed above 717 if(w1.equals(w2)) 727 if(w1.equals(w2)) { 718 728 continue; 719 if(w2.isFirstLastNode(w1.firstNode())) 729 } 730 if(w2.isFirstLastNode(w1.firstNode())) { 720 731 ++i; 721 if(w2.isFirstLastNode(w1.lastNode())) 732 } 733 if(w2.isFirstLastNode(w1.lastNode())) { 722 734 ++i; 735 } 723 736 if(i == 2) // this way closes w1 - take it! 724 737 { 725 if(secondary.size() > 0) 738 if(secondary.size() > 0) { 726 739 secondary.clear(); 740 } 727 741 secondary.add(w2); 728 742 break; 729 743 } 730 else if(i > 0) 744 else if(i > 0) { 731 745 secondary.add(w2); 746 } 732 747 } 733 748 if(k == 0 ? secondary.size() == 1 : secondary.size() > 0) … … 742 757 possibleWays.removeAll(joinThem); 743 758 744 List<Node> nodes = joined.getNodes();759 //List<Node> nodes = joined.getNodes(); 745 760 // check if we added too much 746 761 /*for(int i = 1; i < nodes.size()-2; ++i)
Note:
See TracChangeset
for help on using the changeset viewer.