Changeset 11981 in josm


Ignore:
Timestamp:
2017-04-22T22:55:31+02:00 (7 years ago)
Author:
stoecker
Message:

see #14655 - add more ELI - JOSM checks, new results comment by SKIP text (does not trigger error notes)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.groovy

    r11975 r11981  
    454454            }
    455455        }
     456        myprintln "*** Same URL, but different information: ***"
     457        for (def url : eliUrls.keySet()) {
     458            if (!josmUrls.containsKey(url)) continue
     459            def e = eliUrls.get(url)
     460            def j = josmUrls.get(url)
     461
     462            def et = getDescriptions(e)
     463            def jt = getDescriptions(j)
     464            if (et.size() > 0) et = et["en"]
     465            if (jt.size() > 0) jt = jt["en"]
     466            if (!et.equals(jt)) {
     467                if (!jt) {
     468                    myprintln "+ SKIP - Missing JOSM description (${et}): ${getDescription(j)}"
     469                } else if (et) {
     470                    myprintln "+ SKIP * Description differs (${et} != '${jt}'): ${getDescription(j)}"
     471                } else if (!options.nomissingeli) {
     472                    myprintln "+ Missing ELI description ('${jt}'): ${getDescription(j)}"
     473                }
     474            }
     475
     476            et = getPermissionReferenceUrl(e)
     477            jt = getPermissionReferenceUrl(j)
     478            if (!jt) jt = getTermsOfUseUrl(j)
     479            if (!et.equals(jt)) {
     480                if (!jt) {
     481                    myprintln "+ SKIP - Missing JOSM license URL (${et}): ${getDescription(j)}"
     482                } else if (et) {
     483                    myprintln "+ SKIP * License URL differs (${et} != '${jt}'): ${getDescription(j)}"
     484                } else if (!options.nomissingeli) {
     485                    myprintln "+ Missing ELI license URL ('${jt}'): ${getDescription(j)}"
     486                }
     487            }
     488
     489            et = getAttributionUrl(e)
     490            jt = getAttributionUrl(j)
     491            if (!et.equals(jt)) {
     492                if (!jt) {
     493                    myprintln "+ SKIP - Missing JOSM attribution URL (${et}): ${getDescription(j)}"
     494                } else if (et) {
     495                    myprintln "+ SKIP * Attribution URL differs (${et} != '${jt}'): ${getDescription(j)}"
     496                } else if (!options.nomissingeli) {
     497                    myprintln "+ Missing ELI attribution URL ('${jt}'): ${getDescription(j)}"
     498                }
     499            }
     500
     501            et = getAttributionText(e)
     502            jt = getAttributionText(j)
     503            if (!et.equals(jt)) {
     504                if (!jt) {
     505                    myprintln "+ SKIP - Missing JOSM attribution text (${et}): ${getDescription(j)}"
     506                } else if (et) {
     507                    myprintln "+ SKIP * Attribution text differs (${et} != '${jt}'): ${getDescription(j)}"
     508                } else if (!options.nomissingeli) {
     509                    myprintln "+ Missing ELI attribution text ('${jt}'): ${getDescription(j)}"
     510                }
     511            }
     512
     513            et = getProjections(e)
     514            jt = getProjections(j)
     515            if (et) et = String.join(" ", et.toSorted());
     516            if (jt) jt = String.join(" ", jt.toSorted());
     517            if (!et.equals(jt)) {
     518                if (!jt) {
     519                    myprintln "+ SKIP - Missing JOSM projections (${et}): ${getDescription(j)}"
     520                } else if (et) {
     521                    myprintln "+ SKIP * Projections differ (${et} != '${jt}'): ${getDescription(j)}"
     522                } else if (!options.nomissingeli) {
     523                    myprintln "+ Missing ELI projections ('${jt}'): ${getDescription(j)}"
     524                }
     525            }
     526        }
    456527        myprintln "*** Mismatching shapes: ***"
    457528        for (def url : josmUrls.keySet()) {
     
    647718            r = e.getServerProjections()
    648719        } else {
    649             r = e.get("properties").get("available_projections")
     720            def s = e.get("properties").get("available_projections")
     721            if (s) {
     722                r = []
     723                for (def p : s)
     724                    r += p.getString()
     725            }
     726           
    650727        }
    651728        return r ? r : []
Note: See TracChangeset for help on using the changeset viewer.