Changeset 16962 in osm for applications/editors/josm/plugins
- Timestamp:
- 2009-08-10T12:58:28+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/waydownloader/src/WayDownloaderPlugin.java
r16631 r16962 179 179 for (Node onNode:Main.main.getCurrentDataSet().nodes) { 180 180 if (!onNode.equals(this.selectedNode) 181 && !onNode.incomplete 181 182 && onNode.getCoor().lat()==selectedNode.getCoor().lat() 182 183 && onNode.getCoor().lon()==selectedNode.getCoor().lon()) { … … 189 190 /** Given the the node on one end of the way, return the node on the other end */ 190 191 private Node findOtherEnd(Way way, Node firstEnd) { 191 Node otherEnd = way. nodes.get(0);192 if (otherEnd.equals(firstEnd)) otherEnd = way. nodes.get(way.nodes.size()-1);192 Node otherEnd = way.firstNode(); 193 if (otherEnd.equals(firstEnd)) otherEnd = way.lastNode(); 193 194 return otherEnd; 194 195 } … … 200 201 //loop through every way 201 202 for (Way onWay:Main.main.getCurrentDataSet().ways) { 202 Object[] nodes = onWay.nodes.toArray(); 203 if (nodes.length<2) { 204 //Should never happen should it? TODO: investigate. For the moment ignore these 205 System.err.println("WayDownloader plugin encountered a way with " + nodes.length + " nodes :" + onWay.toString()); 206 } else { 207 Node firstNode = (Node) nodes[0]; 208 Node lastNode = (Node) nodes[nodes.length-1]; 209 210 if (firstNode.equals(selectedNode) || lastNode.equals(selectedNode)) { 203 if (onWay.getNodesCount() >= 2) { 204 if (onWay.isFirstLastNode(selectedNode)) { 211 205 //Found it 212 206 connectedWays.add(onWay); … … 228 222 } else { 229 223 Way selectedWay = (Way) selection.toArray()[0]; 230 selectedNode = selectedWay. nodes.get(0);224 selectedNode = selectedWay.firstNode(); 231 225 232 226 if (isDownloaded(selectedNode)) {
Note:
See TracChangeset
for help on using the changeset viewer.