Changeset 11420 in josm for trunk/scripts
- Timestamp:
- 2016-12-29T22:33:24+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorImageryIndex.groovy
r11415 r11420 34 34 def eiiUrls = new HashMap<String, JsonObject>() 35 35 def josmUrls = new HashMap<String, ImageryInfo>() 36 def josmMirrors = new HashMap<String, ImageryInfo>() 36 37 37 38 static String eiiInputFile = 'imagery.geojson' … … 206 207 myprintln "+++ JOSM-URL is not unique: "+url 207 208 } else { 208 josmUrls.put(url, e)209 josmUrls.put(url, e) 209 210 } 210 211 for (def m : e.getMirrors()) { … … 213 214 myprintln "+++ JOSM-Mirror-URL is not unique: "+url 214 215 } else { 215 josmUrls.put(url, m) 216 josmUrls.put(url, m) 217 josmMirrors.put(url, m) 216 218 } 217 219 } … … 385 387 } 386 388 } 389 myprintln "*** Mismatching icons: ***" 390 for (def url : eiiUrls.keySet()) { 391 def e = eiiUrls.get(url) 392 if (!josmUrls.containsKey(url)) { 393 continue 394 } 395 def j = josmUrls.get(url) 396 def ij = getIcon(j) 397 def ie = getIcon(e) 398 if(ij != null && ie == null) { 399 if(!options.nomissingeii) { 400 myprintln "+ No EII icon: ${getDescription(j)}" 401 } 402 } else if(ij == null && ie != null) { 403 myprintln "- No JOSM icon: ${getDescription(j)}" 404 } else if(!ij.equals(ie)) { 405 myprintln "* Different icons: ${getDescription(j)}" 406 } 407 } 408 myprintln "*** Miscellaneous checks: ***" 409 def josmIds = new HashMap<String, ImageryInfo>() 410 for (def url : josmUrls.keySet()) { 411 def j = josmUrls.get(url) 412 def id = getId(j) 413 if(josmMirrors.containsKey(url)) { 414 continue; 415 } 416 if(id == null) { 417 myprintln "* No JOSM-ID: ${getDescription(j)}" 418 } else if(josmIds.containsKey(id)) { 419 myprintln "* JOSM-ID ${id} not unique: ${getDescription(j)}" 420 } else { 421 josmIds.put(id, j); 422 } 423 } 387 424 } 388 425 … … 393 430 if (e instanceof ImageryInfo) return e.url 394 431 return e.get("properties").getString("url") 432 } 433 static String getId(Object e) { 434 if (e instanceof ImageryInfo) return e.getId() 435 return e.get("properties").getString("id") 395 436 } 396 437 static String getName(Object e) { … … 458 499 return e.get("properties").get("best") ? "best" : null 459 500 } 501 static String getIcon(Object e) { 502 if (e instanceof ImageryInfo) return e.getIcon() 503 return e.get("properties").getString("icon", null) 504 } 460 505 String getDescription(Object o) { 461 506 def url = getUrl(o)
Note:
See TracChangeset
for help on using the changeset viewer.