Changeset 28318 in osm for applications/editors
- Timestamp:
- 2012-04-19T06:41:57+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/public_transport
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/public_transport/build.xml
r28014 r28318 27 27 <!-- this is the directory where the plugin jar is copied to --> 28 28 <property name="plugin.dist.dir" value="${josm.basedir}/dist"/> 29 <property name="ant.build.javac.target" value="1.5"/> 29 <property name="ant.build.javac.source" value="1.6"/> 30 <property name="ant.build.javac.target" value="1.6"/> 30 31 <property name="plugin.dist.dir" value="${josm.basedir}/dist"/> 31 32 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> -
applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java
r28014 r28318 1116 1116 int insPos = itineraryTable.getSelectedRow(); 1117 1117 1118 // Temp 1119 Node firstNode = null; 1120 Node lastNode = null; 1121 1118 1122 for (int i = 0; i < currentRoute.getMembersCount(); ++i) 1119 1123 { … … 1131 1135 1132 1136 itemsToReflect.add(new RelationMember(role, item.getWay())); 1137 1138 // Temp 1139 if (firstNode == null) 1140 { 1141 firstNode = item.getWay().getNode(0); 1142 } 1143 lastNode = item.getWay().getNode(item.getWay().getNodesCount() - 1); 1133 1144 } 1134 1145 else if (item.isNode()) … … 1150 1161 if (currentRoute == ((RouteReference)relsListModel.elementAt(i)).route) 1151 1162 relsList.setSelectedIndex(i); 1163 } 1164 1165 // Temp 1166 if (firstNode != null) 1167 { 1168 Vector< AStarAlgorithm.Edge > path = new PublicTransportAStar(firstNode, lastNode).shortestPath(); 1169 Iterator< AStarAlgorithm.Edge > iter = path.iterator(); 1170 while (iter.hasNext()) 1171 { 1172 PublicTransportAStar.PartialWayEdge edge = (PublicTransportAStar.PartialWayEdge)iter.next(); 1173 System.out.print(edge.way.getUniqueId()); 1174 System.out.print("\t"); 1175 System.out.print(edge.beginIndex); 1176 System.out.print("\t"); 1177 System.out.print(edge.endIndex); 1178 System.out.print("\n"); 1179 } 1152 1180 } 1153 1181 } … … 2108 2136 private void fillStoplistTable 2109 2137 (Iterator<RelationMember> relIter, int insPos) { 2138 2110 2139 while (relIter.hasNext()) 2111 2140 { … … 2115 2144 StopReference sr = detectMinDistance 2116 2145 (curMember.getNode(), segmentMetrics, cbRight.isSelected(), cbLeft.isSelected()); 2117 double offset = segmentMetrics.elementAt((sr.index+1) / 2).distance;2118 System.out.print(sr.index);2119 System.out.print(" ");2120 System.out.print(offset);2121 System.out.print(" ");2122 System.out.println(sr.pos);2123 if (sr.index % 2 == 0)2124 offset += sr.pos;2125 stoplistData.insertRow(insPos, curMember.getNode(), curMember.getRole(), offset);2126 if (insPos >= 0)2127 ++insPos;2146 if (sr == null) 2147 stoplistData.insertRow(insPos, curMember.getNode(), curMember.getRole(), 360.0); 2148 else 2149 { 2150 double offset = segmentMetrics.elementAt((sr.index+1) / 2).distance; 2151 if (sr.index % 2 == 0) 2152 offset += sr.pos; 2153 stoplistData.insertRow(insPos, curMember.getNode(), curMember.getRole(), offset); 2154 if (insPos >= 0) 2155 ++insPos; 2156 } 2128 2157 } 2129 2158 } … … 2174 2203 (Node node, Vector< SegmentMetric > segmentMetrics, 2175 2204 boolean rhsPossible, boolean lhsPossible) { 2176 if (node == null )2205 if (node == null || node.getCoor() == null) 2177 2206 return null; 2178 2207
Note:
See TracChangeset
for help on using the changeset viewer.