@@ -122,18 +122,19 @@ public MendRelationAction(IRelationEditorActionAccess editorAccess) {
122
122
OsmDataLayer layer = editor .getLayer ();
123
123
this .relation = editor .getRelation ();
124
124
editor .addWindowListener (new WindowEventHandler ());
125
- // QUERY = "[out:xml][timeout:180][bbox:{{bbox}}];\n" + "(\n" + " (\n"
126
- // + " way[\"highway\"][\"highway\"!=\"footway\"][\"highway\"!=\"path\"][\"highway\"!=\"cycleway\"];\n"
127
- // + " );\n" + " ._;<;\n" + ");\n" + "(._;>>;>;);\n" + "out meta;";
125
+ // QUERY = "[out:xml][timeout:180][bbox:{{bbox}}];\n" + "(\n" + " (\n"
126
+ // + "
127
+ // way[\"highway\"][\"highway\"!=\"footway\"][\"highway\"!=\"path\"][\"highway\"!=\"cycleway\"];\n"
128
+ // + " );\n" + " ._;<;\n" + ");\n" + "(._;>>;>;);\n" + "out meta;";
128
129
}
129
130
130
131
private String getQuery () {
131
- String str = "[out:xml][ timeout:200 ];\n " + "(\n " + " (\n " ;
132
+ String str = "[timeout:100 ];\n " + "(\n " + " (\n " ;
132
133
133
- String str2 = " [\" highway\" ]\n " + " [\" highway\" !=\" footway\" ]\n " + " [\" highway\" !=\" path\" ]\n "
134
- + " [\" highway\" !=\" cycleway\" ]\n " + " [ \" highway \" != \" service \" ]; \n " + "\n " ;
134
+ String str2 = " [\" highway\" ]" + "[\" highway\" !=\" footway\" ]" + "[\" highway\" !=\" path\" ]"
135
+ + "[\" highway\" !=\" cycleway\" ]" + "\n " ;
135
136
136
- String str3 = " );\n " + " ._;<; \n " + ");\n " + "(._;>> ;>;);\n " + "out meta;" ;
137
+ String str3 = ");\n " + "); \n " + "(._;<; );\n " + "(._;>;);\n " + "out meta;" ;
137
138
138
139
List <Node > nodeList = getBrokenNodes ();
139
140
@@ -225,7 +226,7 @@ void initialise() {
225
226
halt = false ;
226
227
callNextWay (currentIndex );
227
228
}
228
- // callNextWay(currentIndex);
229
+ // callNextWay(currentIndex);
229
230
}
230
231
231
232
void downloadEntireArea () {
@@ -380,7 +381,8 @@ Node checkValidityOfWays(Way way, int nextWayIndex) {
380
381
}
381
382
}
382
383
383
- // check if there is a restricted relation that doesn't allow both the ways together
384
+ // check if there is a restricted relation that doesn't allow both the ways
385
+ // together
384
386
if (node != null ) {
385
387
if (isRestricted (nextWay , way , node )) {
386
388
nextWayDelete = true ;
@@ -1153,7 +1155,7 @@ void downloadAreaAroundWay(Way way, Node node1, Node node2) {
1153
1155
if (abort )
1154
1156
return ;
1155
1157
1156
- if (downloadCounter > 160 || way .isOutsideDownloadArea () || way .isNew ()){
1158
+ if (downloadCounter > 160 || way .isOutsideDownloadArea () || way .isNew ()) {
1157
1159
downloadCounter = 0 ;
1158
1160
1159
1161
DownloadOsmTask task = new DownloadOsmTask ();
@@ -1300,7 +1302,8 @@ void downloadAreaBeforeRemovalOption(List<Way> wayList, List<Integer> Int) {
1300
1302
1301
1303
boolean isRestricted (Way currentWay , Way previousWay , Node commonNode ) {
1302
1304
Set <Relation > parentSet = previousWay .getParentRelations (previousWay .getNodes ());
1303
- if (parentSet == null || parentSet .isEmpty ()) return false ;
1305
+ if (parentSet == null || parentSet .isEmpty ())
1306
+ return false ;
1304
1307
List <Relation > parentRelation = new ArrayList <>(parentSet );
1305
1308
1306
1309
String [] restrictions = new String [] { "restriction" , "restriction:bus" , "restriction:trolleybus" ,
@@ -1338,22 +1341,25 @@ else if (routeValue.equals(sub) && rel.hasKey("restriction:" + sub))
1338
1341
for (Relation r : parentRelation ) {
1339
1342
Collection <RelationMember > prevMemberList = r .getMembersFor (Arrays .asList (previousWay ));
1340
1343
Collection <RelationMember > commonNodeList = r .getMembersFor (Arrays .asList (commonNode ));
1341
- // commonNode is not the node involved in the restriction relation then just continue
1344
+ // commonNode is not the node involved in the restriction relation then just
1345
+ // continue
1342
1346
if (prevMemberList .isEmpty () || commonNodeList .isEmpty ())
1343
1347
continue ;
1344
1348
1345
1349
RelationMember prevMember = prevMemberList .stream ().collect (Collectors .toList ()).get (0 );
1346
1350
final String prevRole = prevMember .getRole ();
1347
1351
1348
1352
if (prevRole .equals ("from" )) {
1349
- String [] acceptedTags = new String [] { "only_right_turn" , "only_left_turn" , "only_u_turn" , "only_straight_on" ,
1350
- "only_entry" , "only_exit" };
1353
+ String [] acceptedTags = new String [] { "only_right_turn" , "only_left_turn" , "only_u_turn" ,
1354
+ "only_straight_on" , " only_entry" , "only_exit" };
1351
1355
for (String s : restrictions ) {
1352
- // if we have any "only" type restrictions then the current way should be in the relation else it is restricted
1356
+ // if we have any "only" type restrictions then the current way should be in the
1357
+ // relation else it is restricted
1353
1358
if (r .hasTag (s , acceptedTags )) {
1354
1359
if (r .getMembersFor (Arrays .asList (currentWay )).isEmpty ()) {
1355
1360
for (String str : acceptedTags ) {
1356
- if (r .hasTag (s ,str )) notice = str + " restriction violated" ;
1361
+ if (r .hasTag (s , str ))
1362
+ notice = str + " restriction violated" ;
1357
1363
}
1358
1364
return true ;
1359
1365
}
@@ -1381,7 +1387,8 @@ else if (routeValue.equals(sub) && rel.hasKey("restriction:" + sub))
1381
1387
for (String s : restrictions )
1382
1388
if (r .hasTag (s , acceptedTags )) {
1383
1389
for (String str : acceptedTags ) {
1384
- if (r .hasTag (s ,str )) notice = str + " restriction violated" ;
1390
+ if (r .hasTag (s , str ))
1391
+ notice = str + " restriction violated" ;
1385
1392
}
1386
1393
return true ;
1387
1394
}
@@ -2203,13 +2210,15 @@ void drawVariants() {
2203
2210
if (!shorterRoutes )
2204
2211
drawFixVariantLetter ("0 : turn-by-turn at next intersection" , Color .ORANGE , letterX , letterY , 25 );
2205
2212
else
2206
- drawFixVariantLetter ("0 : solutions based on other route relations" , Color .PINK , letterX , letterY , 25 );
2213
+ drawFixVariantLetter ("0 : solutions based on other route relations" , Color .PINK , letterX , letterY ,
2214
+ 25 );
2207
2215
letterY = letterY + 60 ;
2208
2216
} else if (showOption0 ) {
2209
2217
if (!shorterRoutes )
2210
2218
drawFixVariantLetter ("W : turn-by-turn at next intersection" , Color .ORANGE , letterX , letterY , 25 );
2211
2219
else
2212
- drawFixVariantLetter ("W : solutions based on other route relations" , Color .PINK , letterX , letterY , 25 );
2220
+ drawFixVariantLetter ("W : solutions based on other route relations" , Color .PINK , letterX , letterY ,
2221
+ 25 );
2213
2222
letterY = letterY + 60 ;
2214
2223
}
2215
2224
@@ -2294,13 +2303,15 @@ void drawMultipleVariants(HashMap<Character, List<Way>> fixVariants) {
2294
2303
if (!shorterRoutes )
2295
2304
drawFixVariantLetter ("0 : turn-by-turn at next intersection" , Color .ORANGE , letterX , letterY , 25 );
2296
2305
else
2297
- drawFixVariantLetter ("0 : solutions based on other route relations" , Color .PINK , letterX , letterY , 25 );
2306
+ drawFixVariantLetter ("0 : solutions based on other route relations" , Color .PINK , letterX , letterY ,
2307
+ 25 );
2298
2308
letterY = letterY + 60 ;
2299
2309
} else if (showOption0 ) {
2300
2310
if (!shorterRoutes )
2301
2311
drawFixVariantLetter ("W : turn-by-turn at next intersection" , Color .ORANGE , letterX , letterY , 25 );
2302
2312
else
2303
- drawFixVariantLetter ("W : solutions based on other route relations" , Color .PINK , letterX , letterY , 25 );
2313
+ drawFixVariantLetter ("W : solutions based on other route relations" , Color .PINK , letterX , letterY ,
2314
+ 25 );
2304
2315
letterY = letterY + 60 ;
2305
2316
}
2306
2317
0 commit comments