Changeset 6619 in josm
- Timestamp:
- 2014-01-04T01:51:27+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java
r6580 r6619 8 8 */ 9 9 public final class WaySegment implements Comparable<WaySegment> { 10 10 11 /** 11 12 * The way. … … 19 20 public int lowerIndex; 20 21 22 /** 23 * Constructs a new {@code WaySegment}. 24 * @param w The way 25 * @param i The node lower index 26 */ 21 27 public WaySegment(Way w, int i) { 22 28 way = w; … … 51 57 } 52 58 53 @Override public boolean equals(Object o) { 59 @Override 60 public boolean equals(Object o) { 54 61 return o instanceof WaySegment 55 62 && ((WaySegment) o).way == way … … 57 64 } 58 65 59 @Override public int hashCode() { 66 @Override 67 public int hashCode() { 60 68 return way.hashCode() ^ lowerIndex; 61 69 } … … 83 91 s2.getSecondNode().getEastNorth().east(), s2.getSecondNode().getEastNorth().north()); 84 92 } 93 94 @Override 95 public String toString() { 96 return "WaySegment [way=" + way.getId() + ", lowerIndex=" + lowerIndex + "]"; 97 } 85 98 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
r6574 r6619 158 158 @Override 159 159 public int compare(WaySegment o1, WaySegment o2) { 160 return o1. way.getNode(o1.lowerIndex).compareTo(o2.way.getNode(o2.lowerIndex));160 return o1.getFirstNode().compareTo(o2.getFirstNode()); 161 161 } 162 162 }); 163 163 final Set<Integer> wayNodesToFix = new TreeSet<Integer>(Collections.reverseOrder()); 164 164 165 for (int i = 0; i < w.getNodesCount() - 1; i++) { 165 166 final boolean wasInSet = !segments.add(new WaySegment(w, i)); … … 168 169 } 169 170 } 170 if ( !wayNodesToFix.isEmpty()) {171 if (wayNodesToFix.size() > 1) { 171 172 final List<Node> newNodes = new ArrayList<Node>(w.getNodes()); 172 173 for (final int i : wayNodesToFix) {
Note:
See TracChangeset
for help on using the changeset viewer.