Changeset 11573 in josm
- Timestamp:
- 2017-02-18T00:11:52+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorImageryIndex.groovy
r11572 r11573 324 324 def j = josmUrls.get(url) 325 325 if (!getQuality(e).equals(getQuality(j))) { 326 myprintln " quality differs: ${getDescription(j)}" 327 myprintln " (EII): ${getQuality(e)}" 328 myprintln " (JOSM): ${getQuality(j)}" 326 myprintln "Quality differs (${getQuality(j)} != ${getQuality(e)}): ${getDescription(j)}" 327 } 328 }*/ 329 /*myprintln "*** Same URL, but different dates: ***" 330 for (def url : eiiUrls.keySet()) { 331 def e = eiiUrls.get(url) 332 if (!josmUrls.containsKey(url)) continue 333 def j = josmUrls.get(url) 334 if (!getDate(e).equals(getDate(j))) { 335 myprintln "Date differs ('${getDate(j)}' != '${getDate(e)}'): ${getDescription(j)}" 329 336 } 330 337 }*/ … … 423 430 } 424 431 def d = getDate(j) 425 if( d != null) {432 if(!d.isEmpty()) { 426 433 def reg = (d =~ /^(\d\d\d\d)(-(\d\d)(-(\d\d))?)?(;(\d\d\d\d)(-(\d\d)(-(\d\d))?)?)?/) 427 434 if(reg == null || reg.count != 1) { … … 472 479 } 473 480 static String getDate(Object e) { 474 if (e instanceof ImageryInfo) return e.date 475 def start = e.get("properties").getString("start_date") 476 def end = e.get("properties").getString("end_date") 477 if(start != null && end != null) 481 if (e instanceof ImageryInfo) return e.date ? e.date : "" 482 def p = e.get("properties") 483 def start = p.containsKey("start_date") ? p.getString("start_date") : "" 484 def end = p.containsKey("end_date") ? p.getString("end_date") : "" 485 if(!start.isEmpty() && !end.isEmpty()) 478 486 return start+";"+end 479 else if( start != null)487 else if(!start.isEmpty()) 480 488 return start 481 489 else
Note:
See TracChangeset
for help on using the changeset viewer.