Changeset 12226 in josm for trunk


Ignore:
Timestamp:
2017-05-22T10:37:50+02:00 (7 years ago)
Author:
stoecker
Message:

add default value to compare script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.groovy

    r12179 r12226  
    244244            if((t = getCountryCode(e)))
    245245                stream.write "        <country-code>$t</country-code>\n"
     246            if((getDefault(e)))
     247                stream.write "        <default>true</default>\n"
    246248            stream.write maininfo(e, "        ")
    247249            if((t = getAttributionText(e)))
     
    369371        }
    370372
    371         /*myprintln "*** Same URL, but different Id: ***"
     373        myprintln "*** Same URL, but different Id: ***"
    372374        for (def url : eliUrls.keySet()) {
    373375            def e = eliUrls.get(url)
     
    377379            def jname = getId(j)
    378380            if (!ename.equals(jname)) {
    379                 myprintln "* Id differs ('${getId(e)}' != '${getId(j)}'): $url"
    380             }
    381         }*/
     381                myprintln "+ SKIP * Id differs ('${getId(e)}' != '${getId(j)}'): $url"
     382            }
     383        }
    382384
    383385        myprintln "*** Same URL, but different type: ***"
     
    537539                } else if (!options.nomissingeli && !getType(e).equals("tms")) {
    538540                    myprintln "+ Missing ELI projections ('${jt}'): ${getDescription(j)}"
     541                }
     542            }
     543
     544            et = getDefault(e)
     545            jt = getDefault(j)
     546            if (!et.equals(jt)) {
     547                if (!jt) {
     548                    myprintln "* SKIP - Missing JOSM default: ${getDescription(j)}"
     549                } else if (!options.nomissingeli) {
     550                    myprintln "+ Missing ELI default: ${getDescription(j)}"
    539551                }
    540552            }
     
    845857        return false
    846858    }
     859    static Boolean getDefault(Object e) {
     860        if (e instanceof ImageryInfo) return e.isDefaultEntry()
     861        return e.get("properties").getBoolean("default", false)
     862    }
    847863    String getDescription(Object o) {
    848864        def url = getUrl(o)
Note: See TracChangeset for help on using the changeset viewer.