[7726] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
| 2 | /**
|
---|
[11854] | 3 | * Compare and analyse the differences of the editor layer index and the JOSM imagery list.
|
---|
[7726] | 4 | * The goal is to keep both lists in sync.
|
---|
| 5 | *
|
---|
[11854] | 6 | * The editor layer index project (https://github.com/osmlab/editor-layer-index)
|
---|
[11694] | 7 | * provides also a version in the JOSM format, but the GEOJSON is the original source
|
---|
[7726] | 8 | * format, so we read that.
|
---|
| 9 | *
|
---|
| 10 | * How to run:
|
---|
| 11 | * -----------
|
---|
| 12 | *
|
---|
| 13 | * Main JOSM binary needs to be in classpath, e.g.
|
---|
| 14 | *
|
---|
[11854] | 15 | * $ groovy -cp ../dist/josm-custom.jar SyncEditorLayerIndex.groovy
|
---|
[9667] | 16 | *
|
---|
[7726] | 17 | * Add option "-h" to show the available command line flags.
|
---|
| 18 | */
|
---|
[11967] | 19 | import java.text.DecimalFormat
|
---|
[7726] | 20 | import javax.json.Json
|
---|
| 21 | import javax.json.JsonArray
|
---|
| 22 | import javax.json.JsonObject
|
---|
| 23 | import javax.json.JsonReader
|
---|
[13831] | 24 | import javax.json.JsonValue
|
---|
[7726] | 25 |
|
---|
[13768] | 26 | import org.openstreetmap.josm.Main
|
---|
[13767] | 27 | import org.openstreetmap.josm.data.Preferences
|
---|
[9953] | 28 | import org.openstreetmap.josm.data.imagery.ImageryInfo
|
---|
[11410] | 29 | import org.openstreetmap.josm.data.imagery.Shape
|
---|
[13767] | 30 | import org.openstreetmap.josm.data.preferences.JosmBaseDirectories
|
---|
[13551] | 31 | import org.openstreetmap.josm.data.projection.Projections
|
---|
| 32 | import org.openstreetmap.josm.data.validation.routines.DomainValidator
|
---|
[7726] | 33 | import org.openstreetmap.josm.io.imagery.ImageryReader
|
---|
[13767] | 34 | import org.openstreetmap.josm.spi.preferences.Config
|
---|
[7726] | 35 |
|
---|
[11854] | 36 | class SyncEditorLayerIndex {
|
---|
[7726] | 37 |
|
---|
[13792] | 38 | List<ImageryInfo> josmEntries
|
---|
| 39 | JsonArray eliEntries
|
---|
[7726] | 40 |
|
---|
[11582] | 41 | def eliUrls = new HashMap<String, JsonObject>()
|
---|
[7726] | 42 | def josmUrls = new HashMap<String, ImageryInfo>()
|
---|
[11420] | 43 | def josmMirrors = new HashMap<String, ImageryInfo>()
|
---|
[13530] | 44 | static def oldproj = new HashMap<String, String>()
|
---|
| 45 | static def ignoreproj = new LinkedList<String>()
|
---|
[9667] | 46 |
|
---|
[11965] | 47 | static String eliInputFile = 'imagery_eli.geojson'
|
---|
| 48 | static String josmInputFile = 'imagery_josm.imagery.xml'
|
---|
| 49 | static String ignoreInputFile = 'imagery_josm.ignores.txt'
|
---|
[12066] | 50 | static FileOutputStream outputFile = null
|
---|
| 51 | static OutputStreamWriter outputStream = null
|
---|
[11582] | 52 | def skip = [:]
|
---|
[9505] | 53 |
|
---|
[7726] | 54 | static def options
|
---|
[9658] | 55 |
|
---|
[7726] | 56 | /**
|
---|
| 57 | * Main method.
|
---|
| 58 | */
|
---|
| 59 | static main(def args) {
|
---|
[13792] | 60 | Locale.setDefault(Locale.ROOT)
|
---|
[7726] | 61 | parse_command_line_arguments(args)
|
---|
[13768] | 62 | Main.determinePlatformHook()
|
---|
[13767] | 63 | def pref = new Preferences(JosmBaseDirectories.getInstance())
|
---|
[13775] | 64 | Config.setPreferencesInstance(pref)
|
---|
[13767] | 65 | pref.init(false)
|
---|
[11854] | 66 | def script = new SyncEditorLayerIndex()
|
---|
[13530] | 67 | script.setupProj()
|
---|
[9505] | 68 | script.loadSkip()
|
---|
[9658] | 69 | script.start()
|
---|
[7726] | 70 | script.loadJosmEntries()
|
---|
[11964] | 71 | if(options.josmxml) {
|
---|
[12066] | 72 | def file = new FileOutputStream(options.josmxml)
|
---|
| 73 | def stream = new OutputStreamWriter(file, "UTF-8")
|
---|
[11964] | 74 | script.printentries(script.josmEntries, stream)
|
---|
[13792] | 75 | stream.close()
|
---|
| 76 | file.close()
|
---|
[11964] | 77 | }
|
---|
[11582] | 78 | script.loadELIEntries()
|
---|
[11964] | 79 | if(options.elixml) {
|
---|
[12066] | 80 | def file = new FileOutputStream(options.elixml)
|
---|
| 81 | def stream = new OutputStreamWriter(file, "UTF-8")
|
---|
[11964] | 82 | script.printentries(script.eliEntries, stream)
|
---|
[13792] | 83 | stream.close()
|
---|
| 84 | file.close()
|
---|
[11964] | 85 | }
|
---|
[7726] | 86 | script.checkInOneButNotTheOther()
|
---|
| 87 | script.checkCommonEntries()
|
---|
[9658] | 88 | script.end()
|
---|
[9505] | 89 | if(outputStream != null) {
|
---|
[13792] | 90 | outputStream.close()
|
---|
[9505] | 91 | }
|
---|
| 92 | if(outputFile != null) {
|
---|
[13792] | 93 | outputFile.close()
|
---|
[9505] | 94 | }
|
---|
[7726] | 95 | }
|
---|
[9653] | 96 |
|
---|
[7726] | 97 | /**
|
---|
| 98 | * Parse command line arguments.
|
---|
| 99 | */
|
---|
| 100 | static void parse_command_line_arguments(args) {
|
---|
[9658] | 101 | def cli = new CliBuilder(width: 160)
|
---|
[9505] | 102 | cli.o(longOpt:'output', args:1, argName: "output", "Output file, - prints to stdout (default: -)")
|
---|
[11854] | 103 | cli.e(longOpt:'eli_input', args:1, argName:"eli_input", "Input file for the editor layer index (geojson). Default is $eliInputFile (current directory).")
|
---|
[9505] | 104 | cli.j(longOpt:'josm_input', args:1, argName:"josm_input", "Input file for the JOSM imagery list (xml). Default is $josmInputFile (current directory).")
|
---|
[11238] | 105 | cli.i(longOpt:'ignore_input', args:1, argName:"ignore_input", "Input file for the ignore list. Default is $ignoreInputFile (current directory).")
|
---|
[7726] | 106 | cli.s(longOpt:'shorten', "shorten the output, so it is easier to read in a console window")
|
---|
[9505] | 107 | cli.n(longOpt:'noskip', argName:"noskip", "don't skip known entries")
|
---|
[9658] | 108 | cli.x(longOpt:'xhtmlbody', argName:"xhtmlbody", "create XHTML body for display in a web page")
|
---|
| 109 | cli.X(longOpt:'xhtml', argName:"xhtml", "create XHTML for display in a web page")
|
---|
[11964] | 110 | cli.p(longOpt:'elixml', args:1, argName:"elixml", "ELI entries for use in JOSM as XML file (incomplete)")
|
---|
| 111 | cli.q(longOpt:'josmxml', args:1, argName:"josmxml", "JOSM entries reoutput as XML file (incomplete)")
|
---|
[11965] | 112 | cli.m(longOpt:'noeli', argName:"noeli", "don't show output for ELI problems")
|
---|
[13619] | 113 | cli.c(longOpt:'encoding', args:1, argName:"encoding", "output encoding (defaults to UTF-8 or cp850 on Windows)")
|
---|
[7726] | 114 | cli.h(longOpt:'help', "show this help")
|
---|
| 115 | options = cli.parse(args)
|
---|
| 116 |
|
---|
| 117 | if (options.h) {
|
---|
| 118 | cli.usage()
|
---|
| 119 | System.exit(0)
|
---|
| 120 | }
|
---|
[11582] | 121 | if (options.eli_input) {
|
---|
| 122 | eliInputFile = options.eli_input
|
---|
[7726] | 123 | }
|
---|
| 124 | if (options.josm_input) {
|
---|
| 125 | josmInputFile = options.josm_input
|
---|
| 126 | }
|
---|
[11238] | 127 | if (options.ignore_input) {
|
---|
| 128 | ignoreInputFile = options.ignore_input
|
---|
| 129 | }
|
---|
[9505] | 130 | if (options.output && options.output != "-") {
|
---|
[12066] | 131 | outputFile = new FileOutputStream(options.output)
|
---|
[13621] | 132 | outputStream = new OutputStreamWriter(outputFile, options.encoding ? options.encoding : "UTF-8")
|
---|
[13620] | 133 | } else if (options.encoding) {
|
---|
| 134 | outputStream = new OutputStreamWriter(System.out, options.encoding)
|
---|
[9505] | 135 | }
|
---|
[7726] | 136 | }
|
---|
| 137 |
|
---|
[13530] | 138 | void setupProj() {
|
---|
| 139 | oldproj.put("EPSG:3359", "EPSG:3404")
|
---|
| 140 | oldproj.put("EPSG:3785", "EPSG:3857")
|
---|
| 141 | oldproj.put("EPSG:31297", "EPGS:31287")
|
---|
[13533] | 142 | oldproj.put("EPSG:31464", "EPSG:31468")
|
---|
[13530] | 143 | oldproj.put("EPSG:54004", "EPSG:3857")
|
---|
| 144 | oldproj.put("EPSG:102100", "EPSG:3857")
|
---|
| 145 | oldproj.put("EPSG:102113", "EPSG:3857")
|
---|
| 146 | oldproj.put("EPSG:900913", "EPGS:3857")
|
---|
| 147 | ignoreproj.add("EPSG:4267")
|
---|
| 148 | ignoreproj.add("EPSG:5221")
|
---|
| 149 | ignoreproj.add("EPSG:5514")
|
---|
| 150 | ignoreproj.add("EPSG:32019")
|
---|
| 151 | ignoreproj.add("EPSG:102066")
|
---|
| 152 | ignoreproj.add("EPSG:102067")
|
---|
| 153 | ignoreproj.add("EPSG:102685")
|
---|
| 154 | ignoreproj.add("EPSG:102711")
|
---|
| 155 | }
|
---|
| 156 |
|
---|
[9505] | 157 | void loadSkip() {
|
---|
[12061] | 158 | def fr = new InputStreamReader(new FileInputStream(ignoreInputFile), "UTF-8")
|
---|
[11238] | 159 | def line
|
---|
| 160 |
|
---|
| 161 | while((line = fr.readLine()) != null) {
|
---|
[11582] | 162 | def res = (line =~ /^\|\| *(ELI|Ignore) *\|\| *\{\{\{(.+)\}\}\} *\|\|/)
|
---|
[11238] | 163 | if(res.count)
|
---|
| 164 | {
|
---|
[11582] | 165 | if(res[0][1].equals("Ignore")) {
|
---|
| 166 | skip[res[0][2]] = "green"
|
---|
[11238] | 167 | } else {
|
---|
[11582] | 168 | skip[res[0][2]] = "darkgoldenrod"
|
---|
[11238] | 169 | }
|
---|
| 170 | }
|
---|
[11234] | 171 | }
|
---|
[11238] | 172 | }
|
---|
[9653] | 173 |
|
---|
[9658] | 174 | void myprintlnfinal(String s) {
|
---|
| 175 | if(outputStream != null) {
|
---|
[12067] | 176 | outputStream.write(s+System.getProperty("line.separator"))
|
---|
[9658] | 177 | } else {
|
---|
[11964] | 178 | println s
|
---|
[9658] | 179 | }
|
---|
| 180 | }
|
---|
| 181 |
|
---|
[9505] | 182 | void myprintln(String s) {
|
---|
[11582] | 183 | if(skip.containsKey(s)) {
|
---|
| 184 | String color = skip.get(s)
|
---|
| 185 | skip.remove(s)
|
---|
[9658] | 186 | if(options.xhtmlbody || options.xhtml) {
|
---|
[11582] | 187 | s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")+"</pre>"
|
---|
[9658] | 188 | }
|
---|
[9662] | 189 | if (!options.noskip) {
|
---|
[11964] | 190 | return
|
---|
[9662] | 191 | }
|
---|
[9658] | 192 | } else if(options.xhtmlbody || options.xhtml) {
|
---|
[13526] | 193 | String color = s.startsWith("***") ? "black" : ((s.startsWith("+ ") || s.startsWith("+++ ELI")) ? "blue" :
|
---|
| 194 | (s.startsWith("#") ? "indigo" : (s.startsWith("!") ? "orange" : "red")))
|
---|
[9658] | 195 | s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")+"</pre>"
|
---|
[9505] | 196 | }
|
---|
[12246] | 197 | if ((s.startsWith("+ ") || s.startsWith("+++ ELI") || s.startsWith("#")) && options.noeli) {
|
---|
[11965] | 198 | return
|
---|
| 199 | }
|
---|
[9658] | 200 | myprintlnfinal(s)
|
---|
| 201 | }
|
---|
| 202 |
|
---|
| 203 | void start() {
|
---|
| 204 | if (options.xhtml) {
|
---|
| 205 | myprintlnfinal "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
|
---|
[11582] | 206 | myprintlnfinal "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/><title>JOSM - ELI differences</title></head><body>\n"
|
---|
[9505] | 207 | }
|
---|
| 208 | }
|
---|
[9653] | 209 |
|
---|
[9658] | 210 | void end() {
|
---|
[11582] | 211 | for (def s: skip.keySet()) {
|
---|
[9658] | 212 | myprintln "+++ Obsolete skip entry: " + s
|
---|
| 213 | }
|
---|
| 214 | if (options.xhtml) {
|
---|
| 215 | myprintlnfinal "</body></html>\n"
|
---|
| 216 | }
|
---|
| 217 | }
|
---|
| 218 |
|
---|
[11582] | 219 | void loadELIEntries() {
|
---|
[13619] | 220 | def fr = new InputStreamReader(new FileInputStream(eliInputFile), "UTF-8")
|
---|
[7726] | 221 | JsonReader jr = Json.createReader(fr)
|
---|
[11582] | 222 | eliEntries = jr.readObject().get("features")
|
---|
[7726] | 223 | jr.close()
|
---|
[9653] | 224 |
|
---|
[11582] | 225 | for (def e : eliEntries) {
|
---|
[12242] | 226 | def url = getUrlStripped(e)
|
---|
[9653] | 227 | if (url.contains("{z}")) {
|
---|
[11582] | 228 | myprintln "+++ ELI-URL uses {z} instead of {zoom}: "+url
|
---|
[9653] | 229 | url = url.replace("{z}","{zoom}")
|
---|
| 230 | }
|
---|
[11582] | 231 | if (eliUrls.containsKey(url)) {
|
---|
| 232 | myprintln "+++ ELI-URL is not unique: "+url
|
---|
[9505] | 233 | } else {
|
---|
[11582] | 234 | eliUrls.put(url, e)
|
---|
[9505] | 235 | }
|
---|
[13530] | 236 | def s = e.get("properties").get("available_projections")
|
---|
| 237 | if (s) {
|
---|
| 238 | def old = new LinkedList<String>()
|
---|
| 239 | for (def p : s) {
|
---|
| 240 | def proj = p.getString()
|
---|
| 241 | if(oldproj.containsKey(proj) || ("CRS:84".equals(proj) && !(url =~ /(?i)version=1\.3/))) {
|
---|
| 242 | old.add(proj)
|
---|
| 243 | }
|
---|
| 244 | }
|
---|
| 245 | if (old) {
|
---|
| 246 | def str = String.join(", ", old)
|
---|
| 247 | myprintln "+ ELI Projections ${str} not useful: ${getDescription(e)}"
|
---|
| 248 | }
|
---|
| 249 | }
|
---|
[7726] | 250 | }
|
---|
[11582] | 251 | myprintln "*** Loaded ${eliEntries.size()} entries (ELI). ***"
|
---|
[7726] | 252 | }
|
---|
[11975] | 253 | String cdata(def s, boolean escape = false) {
|
---|
| 254 | if(escape) {
|
---|
| 255 | return s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">")
|
---|
| 256 | } else if(s =~ /[<>&]/)
|
---|
[11968] | 257 | return "<![CDATA[$s]]>"
|
---|
| 258 | return s
|
---|
| 259 | }
|
---|
[7726] | 260 |
|
---|
[11967] | 261 | String maininfo(def entry, String offset) {
|
---|
[11975] | 262 | String t = getType(entry)
|
---|
| 263 | String res = offset + "<type>$t</type>\n"
|
---|
[11968] | 264 | res += offset + "<url>${cdata(getUrl(entry))}</url>\n"
|
---|
[13474] | 265 | if(getMinZoom(entry) != null)
|
---|
| 266 | res += offset + "<min-zoom>${getMinZoom(entry)}</min-zoom>\n"
|
---|
| 267 | if(getMaxZoom(entry) != null)
|
---|
| 268 | res += offset + "<max-zoom>${getMaxZoom(entry)}</max-zoom>\n"
|
---|
[13476] | 269 | if (t == "wms") {
|
---|
[11975] | 270 | def p = getProjections(entry)
|
---|
| 271 | if (p) {
|
---|
| 272 | res += offset + "<projections>\n"
|
---|
| 273 | for (def c : p)
|
---|
| 274 | res += offset + " <code>$c</code>\n"
|
---|
| 275 | res += offset + "</projections>\n"
|
---|
| 276 | }
|
---|
[11967] | 277 | }
|
---|
| 278 | return res
|
---|
| 279 | }
|
---|
[12061] | 280 |
|
---|
[11964] | 281 | void printentries(def entries, def stream) {
|
---|
[11967] | 282 | DecimalFormat df = new DecimalFormat("#.#######")
|
---|
| 283 | df.setRoundingMode(java.math.RoundingMode.CEILING)
|
---|
[11964] | 284 | stream.write "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
|
---|
| 285 | stream.write "<imagery xmlns=\"http://josm.openstreetmap.de/maps-1.0\">\n"
|
---|
| 286 | for (def e : entries) {
|
---|
[13536] | 287 | stream.write(" <entry"
|
---|
| 288 | + ("eli-best".equals(getQuality(e)) ? " eli-best=\"true\"" : "" )
|
---|
| 289 | + (getOverlay(e) ? " overlay=\"true\"" : "" )
|
---|
| 290 | + ">\n")
|
---|
[11975] | 291 | stream.write " <name>${cdata(getName(e), true)}</name>\n"
|
---|
[11964] | 292 | stream.write " <id>${getId(e)}</id>\n"
|
---|
[11968] | 293 | def t
|
---|
| 294 | if((t = getDate(e)))
|
---|
| 295 | stream.write " <date>$t</date>\n"
|
---|
| 296 | if((t = getCountryCode(e)))
|
---|
| 297 | stream.write " <country-code>$t</country-code>\n"
|
---|
[12226] | 298 | if((getDefault(e)))
|
---|
| 299 | stream.write " <default>true</default>\n"
|
---|
[11975] | 300 | stream.write maininfo(e, " ")
|
---|
| 301 | if((t = getAttributionText(e)))
|
---|
| 302 | stream.write " <attribution-text mandatory=\"true\">${cdata(t, true)}</attribution-text>\n"
|
---|
| 303 | if((t = getAttributionUrl(e)))
|
---|
| 304 | stream.write " <attribution-url>${cdata(t)}</attribution-url>\n"
|
---|
[12261] | 305 | if((t = getLogoImage(e)))
|
---|
| 306 | stream.write " <logo-image>${cdata(t, true)}</logo-image>\n"
|
---|
| 307 | if((t = getLogoUrl(e)))
|
---|
| 308 | stream.write " <logo-url>${cdata(t)}</logo-url>\n"
|
---|
[11975] | 309 | if((t = getTermsOfUseText(e)))
|
---|
| 310 | stream.write " <terms-of-use-text>${cdata(t, true)}</terms-of-use-text>\n"
|
---|
| 311 | if((t = getTermsOfUseUrl(e)))
|
---|
| 312 | stream.write " <terms-of-use-url>${cdata(t)}</terms-of-use-url>\n"
|
---|
| 313 | if((t = getPermissionReferenceUrl(e)))
|
---|
| 314 | stream.write " <permission-ref>${cdata(t)}</permission-ref>\n"
|
---|
| 315 | if((getValidGeoreference(e)))
|
---|
| 316 | stream.write " <valid-georeference>true</valid-georeference>\n"
|
---|
[11968] | 317 | if((t = getIcon(e)))
|
---|
| 318 | stream.write " <icon>${cdata(t)}</icon>\n"
|
---|
[11975] | 319 | for (def d : getDescriptions(e)) {
|
---|
| 320 | stream.write " <description lang=\"${d.getKey()}\">${d.getValue()}</description>\n"
|
---|
| 321 | }
|
---|
[11967] | 322 | for (def m : getMirrors(e)) {
|
---|
| 323 | stream.write " <mirror>\n"+maininfo(m, " ")+" </mirror>\n"
|
---|
| 324 | }
|
---|
[11964] | 325 | def minlat = 1000
|
---|
| 326 | def minlon = 1000
|
---|
| 327 | def maxlat = -1000
|
---|
| 328 | def maxlon = -1000
|
---|
| 329 | def shapes = ""
|
---|
| 330 | def sep = "\n "
|
---|
[13771] | 331 | try {
|
---|
| 332 | for(def s: getShapes(e)) {
|
---|
| 333 | shapes += " <shape>"
|
---|
| 334 | def i = 0
|
---|
| 335 | for(def p: s.getPoints()) {
|
---|
| 336 | def lat = p.getLat()
|
---|
| 337 | def lon = p.getLon()
|
---|
| 338 | if(lat > maxlat) maxlat = lat
|
---|
| 339 | if(lon > maxlon) maxlon = lon
|
---|
| 340 | if(lat < minlat) minlat = lat
|
---|
| 341 | if(lon < minlon) minlon = lon
|
---|
| 342 | if(!(i++%3)) {
|
---|
| 343 | shapes += sep + " "
|
---|
| 344 | }
|
---|
| 345 | shapes += "<point lat='${df.format(lat)}' lon='${df.format(lon)}'/>"
|
---|
[11964] | 346 | }
|
---|
[13771] | 347 | shapes += sep + "</shape>\n"
|
---|
[11964] | 348 | }
|
---|
[13827] | 349 | } catch(IllegalArgumentException ignored) {
|
---|
[11964] | 350 | }
|
---|
| 351 | if(shapes) {
|
---|
[11967] | 352 | stream.write " <bounds min-lat='${df.format(minlat)}' min-lon='${df.format(minlon)}' max-lat='${df.format(maxlat)}' max-lon='${df.format(maxlon)}'>\n"
|
---|
[11964] | 353 | stream.write shapes + " </bounds>\n"
|
---|
| 354 | }
|
---|
[11967] | 355 | stream.write " </entry>\n"
|
---|
[11964] | 356 | }
|
---|
| 357 | stream.write "</imagery>\n"
|
---|
| 358 | stream.close()
|
---|
| 359 | }
|
---|
| 360 |
|
---|
[7726] | 361 | void loadJosmEntries() {
|
---|
| 362 | def reader = new ImageryReader(josmInputFile)
|
---|
| 363 | josmEntries = reader.parse()
|
---|
[9667] | 364 |
|
---|
[7726] | 365 | for (def e : josmEntries) {
|
---|
[12242] | 366 | def url = getUrlStripped(e)
|
---|
[9658] | 367 | if (url.contains("{z}")) {
|
---|
| 368 | myprintln "+++ JOSM-URL uses {z} instead of {zoom}: "+url
|
---|
| 369 | url = url.replace("{z}","{zoom}")
|
---|
| 370 | }
|
---|
[9505] | 371 | if (josmUrls.containsKey(url)) {
|
---|
| 372 | myprintln "+++ JOSM-URL is not unique: "+url
|
---|
| 373 | } else {
|
---|
[11420] | 374 | josmUrls.put(url, e)
|
---|
[7726] | 375 | }
|
---|
[9658] | 376 | for (def m : e.getMirrors()) {
|
---|
[12242] | 377 | url = getUrlStripped(m)
|
---|
[11574] | 378 | m.origName = m.getOriginalName().replaceAll(" mirror server( \\d+)?","")
|
---|
[9658] | 379 | if (josmUrls.containsKey(url)) {
|
---|
| 380 | myprintln "+++ JOSM-Mirror-URL is not unique: "+url
|
---|
| 381 | } else {
|
---|
[11420] | 382 | josmUrls.put(url, m)
|
---|
| 383 | josmMirrors.put(url, m)
|
---|
[9658] | 384 | }
|
---|
| 385 | }
|
---|
[7726] | 386 | }
|
---|
[9505] | 387 | myprintln "*** Loaded ${josmEntries.size()} entries (JOSM). ***"
|
---|
[7726] | 388 | }
|
---|
| 389 |
|
---|
[13593] | 390 | void checkInOneButNotTheOther() {
|
---|
| 391 | def le = new LinkedList<String>(eliUrls.keySet())
|
---|
| 392 | def lj = new LinkedList<String>(josmUrls.keySet())
|
---|
| 393 |
|
---|
| 394 | def ke = new LinkedList<String>(le)
|
---|
| 395 | for (def url : ke) {
|
---|
| 396 | if(lj.contains(url)) {
|
---|
| 397 | le.remove(url)
|
---|
| 398 | lj.remove(url)
|
---|
| 399 | }
|
---|
| 400 | }
|
---|
| 401 |
|
---|
| 402 | if(le && lj) {
|
---|
| 403 | ke = new LinkedList<String>(le)
|
---|
| 404 | for (def urle : ke) {
|
---|
| 405 | def e = eliUrls.get(urle)
|
---|
| 406 | def ide = getId(e)
|
---|
| 407 | String urlhttps = urle.replace("http:","https:")
|
---|
| 408 | if(lj.contains(urlhttps))
|
---|
[13517] | 409 | {
|
---|
[13714] | 410 | myprintln "+ Missing https: ${getDescription(e)}"
|
---|
[13593] | 411 | eliUrls.put(urlhttps, eliUrls.get(urle))
|
---|
| 412 | eliUrls.remove(urle)
|
---|
| 413 | le.remove(urle)
|
---|
[13714] | 414 | lj.remove(urlhttps)
|
---|
[13593] | 415 | } else if(ide) {
|
---|
| 416 | def kj = new LinkedList<String>(lj)
|
---|
| 417 | for (def urlj : kj) {
|
---|
| 418 | def j = josmUrls.get(urlj)
|
---|
| 419 | def idj = getId(j)
|
---|
[13714] | 420 |
|
---|
[13593] | 421 | if (ide.equals(idj) && getType(j) == getType(e)) {
|
---|
| 422 | myprintln "* URL for id ${idj} differs ($urle): ${getDescription(j)}"
|
---|
| 423 | le.remove(urle)
|
---|
| 424 | lj.remove(urlj)
|
---|
| 425 | /* replace key for this entry with JOSM URL */
|
---|
| 426 | eliUrls.remove(e)
|
---|
| 427 | eliUrls.put(urlj,e)
|
---|
[13792] | 428 | break
|
---|
[13593] | 429 | }
|
---|
| 430 | }
|
---|
[13517] | 431 | }
|
---|
[7726] | 432 | }
|
---|
| 433 | }
|
---|
[13714] | 434 |
|
---|
[13593] | 435 | myprintln "*** URLs found in ELI but not in JOSM (${le.size()}): ***"
|
---|
| 436 | le.sort()
|
---|
| 437 | if (!le.isEmpty()) {
|
---|
| 438 | for (def l : le) {
|
---|
| 439 | myprintln "- " + getDescription(eliUrls.get(l))
|
---|
[11412] | 440 | }
|
---|
[7726] | 441 | }
|
---|
[13593] | 442 | myprintln "*** URLs found in JOSM but not in ELI (${lj.size()}): ***"
|
---|
| 443 | lj.sort()
|
---|
| 444 | if (!lj.isEmpty()) {
|
---|
| 445 | for (def l : lj) {
|
---|
| 446 | myprintln "+ " + getDescription(josmUrls.get(l))
|
---|
[11412] | 447 | }
|
---|
[7726] | 448 | }
|
---|
| 449 | }
|
---|
[9667] | 450 |
|
---|
[7726] | 451 | void checkCommonEntries() {
|
---|
[9505] | 452 | myprintln "*** Same URL, but different name: ***"
|
---|
[11582] | 453 | for (def url : eliUrls.keySet()) {
|
---|
| 454 | def e = eliUrls.get(url)
|
---|
[7726] | 455 | if (!josmUrls.containsKey(url)) continue
|
---|
| 456 | def j = josmUrls.get(url)
|
---|
[12061] | 457 | def ename = getName(e).replace("'","\u2019")
|
---|
| 458 | def jname = getName(j).replace("'","\u2019")
|
---|
[11951] | 459 | if (!ename.equals(jname)) {
|
---|
[12242] | 460 | myprintln "* Name differs ('${getName(e)}' != '${getName(j)}'): ${getUrl(j)}"
|
---|
[7726] | 461 | }
|
---|
| 462 | }
|
---|
[9667] | 463 |
|
---|
[12226] | 464 | myprintln "*** Same URL, but different Id: ***"
|
---|
[12126] | 465 | for (def url : eliUrls.keySet()) {
|
---|
| 466 | def e = eliUrls.get(url)
|
---|
| 467 | if (!josmUrls.containsKey(url)) continue
|
---|
| 468 | def j = josmUrls.get(url)
|
---|
| 469 | def ename = getId(e)
|
---|
| 470 | def jname = getId(j)
|
---|
| 471 | if (!ename.equals(jname)) {
|
---|
[12245] | 472 | myprintln "# Id differs ('${getId(e)}' != '${getId(j)}'): ${getUrl(j)}"
|
---|
[12126] | 473 | }
|
---|
[12226] | 474 | }
|
---|
[12126] | 475 |
|
---|
[9505] | 476 | myprintln "*** Same URL, but different type: ***"
|
---|
[11582] | 477 | for (def url : eliUrls.keySet()) {
|
---|
| 478 | def e = eliUrls.get(url)
|
---|
[7726] | 479 | if (!josmUrls.containsKey(url)) continue
|
---|
| 480 | def j = josmUrls.get(url)
|
---|
| 481 | if (!getType(e).equals(getType(j))) {
|
---|
[12242] | 482 | myprintln "* Type differs (${getType(e)} != ${getType(j)}): ${getName(j)} - ${getUrl(j)}"
|
---|
[7726] | 483 | }
|
---|
| 484 | }
|
---|
[9667] | 485 |
|
---|
[9505] | 486 | myprintln "*** Same URL, but different zoom bounds: ***"
|
---|
[11582] | 487 | for (def url : eliUrls.keySet()) {
|
---|
| 488 | def e = eliUrls.get(url)
|
---|
[7726] | 489 | if (!josmUrls.containsKey(url)) continue
|
---|
| 490 | def j = josmUrls.get(url)
|
---|
| 491 |
|
---|
| 492 | Integer eMinZoom = getMinZoom(e)
|
---|
| 493 | Integer jMinZoom = getMinZoom(j)
|
---|
[9518] | 494 | if (eMinZoom != jMinZoom && !(eMinZoom == 0 && jMinZoom == null)) {
|
---|
[11582] | 495 | myprintln "* Minzoom differs (${eMinZoom} != ${jMinZoom}): ${getDescription(j)}"
|
---|
[7726] | 496 | }
|
---|
| 497 | Integer eMaxZoom = getMaxZoom(e)
|
---|
| 498 | Integer jMaxZoom = getMaxZoom(j)
|
---|
| 499 | if (eMaxZoom != jMaxZoom) {
|
---|
[11582] | 500 | myprintln "* Maxzoom differs (${eMaxZoom} != ${jMaxZoom}): ${getDescription(j)}"
|
---|
[7726] | 501 | }
|
---|
| 502 | }
|
---|
[9667] | 503 |
|
---|
[9505] | 504 | myprintln "*** Same URL, but different country code: ***"
|
---|
[11582] | 505 | for (def url : eliUrls.keySet()) {
|
---|
| 506 | def e = eliUrls.get(url)
|
---|
[7726] | 507 | if (!josmUrls.containsKey(url)) continue
|
---|
| 508 | def j = josmUrls.get(url)
|
---|
| 509 | if (!getCountryCode(e).equals(getCountryCode(j))) {
|
---|
[11582] | 510 | myprintln "* Country code differs (${getCountryCode(e)} != ${getCountryCode(j)}): ${getDescription(j)}"
|
---|
[7726] | 511 | }
|
---|
| 512 | }
|
---|
[11599] | 513 | myprintln "*** Same URL, but different quality: ***"
|
---|
[11582] | 514 | for (def url : eliUrls.keySet()) {
|
---|
| 515 | def e = eliUrls.get(url)
|
---|
[9515] | 516 | if (!josmUrls.containsKey(url)) {
|
---|
| 517 | def q = getQuality(e)
|
---|
[11582] | 518 | if("eli-best".equals(q)) {
|
---|
| 519 | myprintln "- Quality best entry not in JOSM for ${getDescription(e)}"
|
---|
[9515] | 520 | }
|
---|
| 521 | continue
|
---|
| 522 | }
|
---|
[9505] | 523 | def j = josmUrls.get(url)
|
---|
| 524 | if (!getQuality(e).equals(getQuality(j))) {
|
---|
[11582] | 525 | myprintln "* Quality differs (${getQuality(e)} != ${getQuality(j)}): ${getDescription(j)}"
|
---|
[9505] | 526 | }
|
---|
[11599] | 527 | }
|
---|
[11665] | 528 | myprintln "*** Same URL, but different dates: ***"
|
---|
[11582] | 529 | for (def url : eliUrls.keySet()) {
|
---|
[11612] | 530 | def ed = getDate(eliUrls.get(url))
|
---|
[11573] | 531 | if (!josmUrls.containsKey(url)) continue
|
---|
| 532 | def j = josmUrls.get(url)
|
---|
[11612] | 533 | def jd = getDate(j)
|
---|
| 534 | // The forms 2015;- or -;2015 or 2015;2015 are handled equal to 2015
|
---|
[11964] | 535 | String ef = ed.replaceAll("\\A-;","").replaceAll(";-\\z","").replaceAll("\\A([0-9-]+);\\1\\z","\$1")
|
---|
[11639] | 536 | // ELI has a strange and inconsistent used end_date definition, so we try again with subtraction by one
|
---|
[11964] | 537 | String ed2 = ed
|
---|
[11639] | 538 | def reg = (ed =~ /^(.*;)(\d\d\d\d)(-(\d\d)(-(\d\d))?)?$/)
|
---|
| 539 | if(reg != null && reg.count == 1) {
|
---|
[11964] | 540 | Calendar cal = Calendar.getInstance()
|
---|
[11639] | 541 | cal.set(reg[0][2] as Integer, reg[0][4] == null ? 0 : (reg[0][4] as Integer)-1, reg[0][6] == null ? 1 : reg[0][6] as Integer)
|
---|
| 542 | cal.add(Calendar.DAY_OF_MONTH, -1)
|
---|
[11667] | 543 | ed2 = reg[0][1] + cal.get(Calendar.YEAR)
|
---|
[11639] | 544 | if (reg[0][4] != null)
|
---|
| 545 | ed2 += "-" + String.format("%02d", cal.get(Calendar.MONTH)+1)
|
---|
| 546 | if (reg[0][6] != null)
|
---|
| 547 | ed2 += "-" + String.format("%02d", cal.get(Calendar.DAY_OF_MONTH))
|
---|
| 548 | }
|
---|
[11964] | 549 | String ef2 = ed2.replaceAll("\\A-;","").replaceAll(";-\\z","").replaceAll("\\A([0-9-]+);\\1\\z","\$1")
|
---|
[11639] | 550 | if (!ed.equals(jd) && !ef.equals(jd) && !ed2.equals(jd) && !ef2.equals(jd)) {
|
---|
[11964] | 551 | String t = "'${ed}'"
|
---|
[11612] | 552 | if (!ed.equals(ef)) {
|
---|
[11964] | 553 | t += " or '${ef}'"
|
---|
[11612] | 554 | }
|
---|
[11666] | 555 | if (jd.isEmpty()) {
|
---|
| 556 | myprintln "- Missing JOSM date (${t}): ${getDescription(j)}"
|
---|
[11668] | 557 | } else if (!ed.isEmpty()) {
|
---|
[12145] | 558 | myprintln "* Date differs ('${t}' != '${jd}'): ${getDescription(j)}"
|
---|
[11668] | 559 | } else if (!options.nomissingeli) {
|
---|
[11666] | 560 | myprintln "+ Missing ELI date ('${jd}'): ${getDescription(j)}"
|
---|
| 561 | }
|
---|
[11573] | 562 | }
|
---|
[11665] | 563 | }
|
---|
[11981] | 564 | myprintln "*** Same URL, but different information: ***"
|
---|
| 565 | for (def url : eliUrls.keySet()) {
|
---|
| 566 | if (!josmUrls.containsKey(url)) continue
|
---|
| 567 | def e = eliUrls.get(url)
|
---|
| 568 | def j = josmUrls.get(url)
|
---|
| 569 |
|
---|
| 570 | def et = getDescriptions(e)
|
---|
| 571 | def jt = getDescriptions(j)
|
---|
[12008] | 572 | et = (et.size() > 0) ? et["en"] : ""
|
---|
| 573 | jt = (jt.size() > 0) ? jt["en"] : ""
|
---|
[12086] | 574 | if (!et.equals(jt)) {
|
---|
[11981] | 575 | if (!jt) {
|
---|
[12179] | 576 | myprintln "- Missing JOSM description (${et}): ${getDescription(j)}"
|
---|
[11981] | 577 | } else if (et) {
|
---|
[12145] | 578 | myprintln "* Description differs ('${et}' != '${jt}'): ${getDescription(j)}"
|
---|
[11981] | 579 | } else if (!options.nomissingeli) {
|
---|
| 580 | myprintln "+ Missing ELI description ('${jt}'): ${getDescription(j)}"
|
---|
| 581 | }
|
---|
| 582 | }
|
---|
| 583 |
|
---|
| 584 | et = getPermissionReferenceUrl(e)
|
---|
| 585 | jt = getPermissionReferenceUrl(j)
|
---|
[13578] | 586 | def jt2 = getTermsOfUseUrl(j)
|
---|
| 587 | if (!jt) jt = jt2
|
---|
[11981] | 588 | if (!et.equals(jt)) {
|
---|
| 589 | if (!jt) {
|
---|
[12266] | 590 | myprintln "- Missing JOSM license URL (${et}): ${getDescription(j)}"
|
---|
[11981] | 591 | } else if (et) {
|
---|
[13551] | 592 | def ethttps = et.replace("http:","https:")
|
---|
[13578] | 593 | if(!jt2 || !(jt2.equals(ethttps) || jt2.equals(et+"/") || jt2.equals(ethttps+"/"))) {
|
---|
| 594 | if(jt.equals(ethttps) || jt.equals(et+"/") || jt.equals(ethttps+"/")) {
|
---|
| 595 | myprintln "+ License URL differs ('${et}' != '${jt}'): ${getDescription(j)}"
|
---|
| 596 | } else {
|
---|
[13579] | 597 | def ja = getAttributionUrl(j)
|
---|
[13580] | 598 | if (ja && (ja.equals(et) || ja.equals(ethttps) || ja.equals(et+"/") || ja.equals(ethttps+"/"))) {
|
---|
[13579] | 599 | myprintln "+ ELI License URL in JOSM Attribution: ${getDescription(j)}"
|
---|
| 600 | } else {
|
---|
| 601 | myprintln "* License URL differs ('${et}' != '${jt}'): ${getDescription(j)}"
|
---|
| 602 | }
|
---|
[13578] | 603 | }
|
---|
[13551] | 604 | }
|
---|
[11981] | 605 | } else if (!options.nomissingeli) {
|
---|
| 606 | myprintln "+ Missing ELI license URL ('${jt}'): ${getDescription(j)}"
|
---|
| 607 | }
|
---|
| 608 | }
|
---|
| 609 |
|
---|
| 610 | et = getAttributionUrl(e)
|
---|
| 611 | jt = getAttributionUrl(j)
|
---|
| 612 | if (!et.equals(jt)) {
|
---|
| 613 | if (!jt) {
|
---|
[12143] | 614 | myprintln "- Missing JOSM attribution URL (${et}): ${getDescription(j)}"
|
---|
[11981] | 615 | } else if (et) {
|
---|
[13518] | 616 | def ethttps = et.replace("http:","https:")
|
---|
[13551] | 617 | if(jt.equals(ethttps) || jt.equals(et+"/") || jt.equals(ethttps+"/")) {
|
---|
[13518] | 618 | myprintln "+ Attribution URL differs ('${et}' != '${jt}'): ${getDescription(j)}"
|
---|
| 619 | } else {
|
---|
| 620 | myprintln "* Attribution URL differs ('${et}' != '${jt}'): ${getDescription(j)}"
|
---|
| 621 | }
|
---|
[11981] | 622 | } else if (!options.nomissingeli) {
|
---|
| 623 | myprintln "+ Missing ELI attribution URL ('${jt}'): ${getDescription(j)}"
|
---|
| 624 | }
|
---|
| 625 | }
|
---|
| 626 |
|
---|
| 627 | et = getAttributionText(e)
|
---|
| 628 | jt = getAttributionText(j)
|
---|
| 629 | if (!et.equals(jt)) {
|
---|
| 630 | if (!jt) {
|
---|
[12143] | 631 | myprintln "- Missing JOSM attribution text (${et}): ${getDescription(j)}"
|
---|
[11981] | 632 | } else if (et) {
|
---|
[12266] | 633 | myprintln "* Attribution text differs ('${et}' != '${jt}'): ${getDescription(j)}"
|
---|
[11981] | 634 | } else if (!options.nomissingeli) {
|
---|
| 635 | myprintln "+ Missing ELI attribution text ('${jt}'): ${getDescription(j)}"
|
---|
| 636 | }
|
---|
| 637 | }
|
---|
| 638 |
|
---|
| 639 | et = getProjections(e)
|
---|
| 640 | jt = getProjections(j)
|
---|
[11983] | 641 | if (et) { et = new LinkedList(et); Collections.sort(et); et = String.join(" ", et) }
|
---|
| 642 | if (jt) { jt = new LinkedList(jt); Collections.sort(jt); jt = String.join(" ", jt) }
|
---|
[11981] | 643 | if (!et.equals(jt)) {
|
---|
| 644 | if (!jt) {
|
---|
[13592] | 645 | def t = getType(e)
|
---|
| 646 | if(t == "wms_endpoint" || t == "tms") {
|
---|
| 647 | myprintln "+ ELI projections for type ${t}: ${getDescription(j)}"
|
---|
| 648 | }
|
---|
| 649 | else {
|
---|
| 650 | myprintln "- Missing JOSM projections (${et}): ${getDescription(j)}"
|
---|
| 651 | }
|
---|
[11981] | 652 | } else if (et) {
|
---|
[13538] | 653 | if("EPSG:3857 EPSG:4326".equals(et) || "EPSG:3857".equals(et) || "EPSG:4326".equals(et)) {
|
---|
| 654 | myprintln "+ ELI has minimal projections ('${et}' != '${jt}'): ${getDescription(j)}"
|
---|
| 655 | } else {
|
---|
| 656 | myprintln "* Projections differ ('${et}' != '${jt}'): ${getDescription(j)}"
|
---|
| 657 | }
|
---|
[12144] | 658 | } else if (!options.nomissingeli && !getType(e).equals("tms")) {
|
---|
[11981] | 659 | myprintln "+ Missing ELI projections ('${jt}'): ${getDescription(j)}"
|
---|
| 660 | }
|
---|
| 661 | }
|
---|
[12226] | 662 |
|
---|
| 663 | et = getDefault(e)
|
---|
| 664 | jt = getDefault(j)
|
---|
| 665 | if (!et.equals(jt)) {
|
---|
| 666 | if (!jt) {
|
---|
[12227] | 667 | myprintln "- Missing JOSM default: ${getDescription(j)}"
|
---|
[12226] | 668 | } else if (!options.nomissingeli) {
|
---|
| 669 | myprintln "+ Missing ELI default: ${getDescription(j)}"
|
---|
| 670 | }
|
---|
| 671 | }
|
---|
[13536] | 672 | et = getOverlay(e)
|
---|
| 673 | jt = getOverlay(j)
|
---|
| 674 | if (!et.equals(jt)) {
|
---|
| 675 | if (!jt) {
|
---|
[13549] | 676 | myprintln "- Missing JOSM overlay flag: ${getDescription(j)}"
|
---|
[13536] | 677 | } else if (!options.nomissingeli) {
|
---|
| 678 | myprintln "+ Missing ELI overlay flag: ${getDescription(j)}"
|
---|
| 679 | }
|
---|
| 680 | }
|
---|
[11981] | 681 | }
|
---|
[11410] | 682 | myprintln "*** Mismatching shapes: ***"
|
---|
| 683 | for (def url : josmUrls.keySet()) {
|
---|
| 684 | def j = josmUrls.get(url)
|
---|
| 685 | def num = 1
|
---|
| 686 | for (def shape : getShapes(j)) {
|
---|
| 687 | def p = shape.getPoints()
|
---|
| 688 | if(!p[0].equals(p[p.size()-1])) {
|
---|
| 689 | myprintln "+++ JOSM shape $num unclosed: ${getDescription(j)}"
|
---|
| 690 | }
|
---|
[11964] | 691 | for (def nump = 1; nump < p.size(); ++nump) {
|
---|
| 692 | if (p[nump-1] == p[nump]) {
|
---|
| 693 | myprintln "+++ JOSM shape $num double point at ${nump-1}: ${getDescription(j)}"
|
---|
| 694 | }
|
---|
| 695 | }
|
---|
[11410] | 696 | ++num
|
---|
| 697 | }
|
---|
| 698 | }
|
---|
[11582] | 699 | for (def url : eliUrls.keySet()) {
|
---|
| 700 | def e = eliUrls.get(url)
|
---|
[11410] | 701 | def num = 1
|
---|
[13771] | 702 | def s
|
---|
| 703 | try {
|
---|
| 704 | s = getShapes(e)
|
---|
| 705 | for (def shape : s) {
|
---|
| 706 | def p = shape.getPoints()
|
---|
| 707 | if(!p[0].equals(p[p.size()-1]) && !options.nomissingeli) {
|
---|
| 708 | myprintln "+++ ELI shape $num unclosed: ${getDescription(e)}"
|
---|
[11964] | 709 | }
|
---|
[13771] | 710 | for (def nump = 1; nump < p.size(); ++nump) {
|
---|
| 711 | if (p[nump-1] == p[nump]) {
|
---|
| 712 | myprintln "+++ ELI shape $num double point at ${nump-1}: ${getDescription(e)}"
|
---|
| 713 | }
|
---|
| 714 | }
|
---|
| 715 | ++num
|
---|
[11964] | 716 | }
|
---|
[13771] | 717 | } catch(IllegalArgumentException err) {
|
---|
| 718 | def desc = getDescription(e)
|
---|
| 719 | myprintln("* Invalid data in ELI geometry for $desc: ${err.getMessage()}")
|
---|
[11410] | 720 | }
|
---|
[13780] | 721 | if (s == null || !josmUrls.containsKey(url)) {
|
---|
[11410] | 722 | continue
|
---|
| 723 | }
|
---|
| 724 | def j = josmUrls.get(url)
|
---|
[11411] | 725 | def js = getShapes(j)
|
---|
[11414] | 726 | if(!s.size() && js.size()) {
|
---|
[11582] | 727 | if(!options.nomissingeli) {
|
---|
| 728 | myprintln "+ No ELI shape: ${getDescription(j)}"
|
---|
[11414] | 729 | }
|
---|
[11413] | 730 | } else if(!js.size() && s.size()) {
|
---|
[11415] | 731 | // don't report boundary like 5 point shapes as difference
|
---|
| 732 | if (s.size() != 1 || s[0].getPoints().size() != 5) {
|
---|
| 733 | myprintln "- No JOSM shape: ${getDescription(j)}"
|
---|
| 734 | }
|
---|
[11414] | 735 | } else if(s.size() != js.size()) {
|
---|
| 736 | myprintln "* Different number of shapes (${s.size()} != ${js.size()}): ${getDescription(j)}"
|
---|
[11413] | 737 | } else {
|
---|
[11414] | 738 | for(def nums = 0; nums < s.size(); ++nums) {
|
---|
| 739 | def ep = s[nums].getPoints()
|
---|
| 740 | def jp = js[nums].getPoints()
|
---|
| 741 | if(ep.size() != jp.size()) {
|
---|
| 742 | myprintln "* Different number of points for shape ${nums+1} (${ep.size()} ! = ${jp.size()})): ${getDescription(j)}"
|
---|
| 743 | } else {
|
---|
| 744 | for(def nump = 0; nump < ep.size(); ++nump) {
|
---|
| 745 | def ept = ep[nump]
|
---|
| 746 | def jpt = jp[nump]
|
---|
[13771] | 747 | if(Math.abs(ept.getLat()-jpt.getLat()) > 0.00001 || Math.abs(ept.getLon()-jpt.getLon()) > 0.00001) {
|
---|
[11414] | 748 | myprintln "* Different coordinate for point ${nump+1} of shape ${nums+1}: ${getDescription(j)}"
|
---|
| 749 | nump = ep.size()
|
---|
| 750 | num = s.size()
|
---|
[11413] | 751 | }
|
---|
| 752 | }
|
---|
| 753 | }
|
---|
[11411] | 754 | }
|
---|
[11410] | 755 | }
|
---|
| 756 | }
|
---|
[11420] | 757 | myprintln "*** Mismatching icons: ***"
|
---|
[11582] | 758 | for (def url : eliUrls.keySet()) {
|
---|
| 759 | def e = eliUrls.get(url)
|
---|
[11420] | 760 | if (!josmUrls.containsKey(url)) {
|
---|
| 761 | continue
|
---|
| 762 | }
|
---|
| 763 | def j = josmUrls.get(url)
|
---|
| 764 | def ij = getIcon(j)
|
---|
| 765 | def ie = getIcon(e)
|
---|
| 766 | if(ij != null && ie == null) {
|
---|
[11582] | 767 | if(!options.nomissingeli) {
|
---|
| 768 | myprintln "+ No ELI icon: ${getDescription(j)}"
|
---|
[11420] | 769 | }
|
---|
| 770 | } else if(ij == null && ie != null) {
|
---|
| 771 | myprintln "- No JOSM icon: ${getDescription(j)}"
|
---|
| 772 | } else if(!ij.equals(ie)) {
|
---|
| 773 | myprintln "* Different icons: ${getDescription(j)}"
|
---|
| 774 | }
|
---|
| 775 | }
|
---|
| 776 | myprintln "*** Miscellaneous checks: ***"
|
---|
| 777 | def josmIds = new HashMap<String, ImageryInfo>()
|
---|
[13527] | 778 | def all = Projections.getAllProjectionCodes()
|
---|
[13551] | 779 | DomainValidator dv = DomainValidator.getInstance();
|
---|
[11420] | 780 | for (def url : josmUrls.keySet()) {
|
---|
| 781 | def j = josmUrls.get(url)
|
---|
| 782 | def id = getId(j)
|
---|
[13526] | 783 | if("wms".equals(getType(j))) {
|
---|
| 784 | if(!getProjections(j)) {
|
---|
| 785 | myprintln "* WMS without projections: ${getDescription(j)}"
|
---|
| 786 | } else {
|
---|
[13527] | 787 | def unsupported = new LinkedList<String>()
|
---|
| 788 | def old = new LinkedList<String>()
|
---|
[13530] | 789 | for (def p : getProjectionsUnstripped(j)) {
|
---|
[13526] | 790 | if("CRS:84".equals(p)) {
|
---|
| 791 | if(!(url =~ /(?i)version=1\.3/)) {
|
---|
[13533] | 792 | myprintln "* CRS:84 without WMS 1.3: ${getDescription(j)}"
|
---|
[13526] | 793 | }
|
---|
[13527] | 794 | } else if(oldproj.containsKey(p)) {
|
---|
| 795 | old.add(p)
|
---|
[13528] | 796 | } else if(!all.contains(p) && !ignoreproj.contains(p)) {
|
---|
[13526] | 797 | unsupported.add(p)
|
---|
| 798 | }
|
---|
| 799 | }
|
---|
| 800 | if (unsupported) {
|
---|
[13527] | 801 | def s = String.join(", ", unsupported)
|
---|
[13533] | 802 | myprintln "* Projections ${s} not supported by JOSM: ${getDescription(j)}"
|
---|
[13526] | 803 | }
|
---|
[13527] | 804 | for (def o : old) {
|
---|
[13533] | 805 | myprintln "* Projection ${o} is an old unsupported code and has been replaced by ${oldproj.get(o)}: ${getDescription(j)}"
|
---|
[13527] | 806 | }
|
---|
[13526] | 807 | }
|
---|
| 808 | if((url =~ /(?i)version=1\.3/) && !(url =~ /[Cc][Rr][Ss]=\{proj\}/)) {
|
---|
| 809 | myprintln "* WMS 1.3 with strange CRS specification: ${getDescription(j)}"
|
---|
| 810 | }
|
---|
| 811 | if((url =~ /(?i)version=1\.1/) && !(url =~ /[Ss][Rr][Ss]=\{proj\}/)) {
|
---|
| 812 | myprintln "* WMS 1.1 with strange SRS specification: ${getDescription(j)}"
|
---|
| 813 | }
|
---|
[13511] | 814 | }
|
---|
[13551] | 815 | def urls = new LinkedList<String>()
|
---|
| 816 | if(!"scanex".equals(getType(j))) {
|
---|
| 817 | urls += url
|
---|
[13532] | 818 | }
|
---|
[13551] | 819 | def jt = getPermissionReferenceUrl(j)
|
---|
[13552] | 820 | if(jt && !"Public Domain".equals(jt))
|
---|
[13551] | 821 | urls += jt
|
---|
| 822 | jt = getTermsOfUseUrl(j)
|
---|
| 823 | if(jt)
|
---|
| 824 | urls += jt
|
---|
| 825 | jt = getAttributionUrl(j)
|
---|
| 826 | if(jt)
|
---|
| 827 | urls += jt
|
---|
[13553] | 828 | jt = getIcon(j)
|
---|
| 829 | if(jt && !(jt =~ /^data:image\/png;base64,/))
|
---|
| 830 | urls += jt
|
---|
[13551] | 831 | for(def u : urls) {
|
---|
| 832 | def m = u =~ /^https?:\/\/([^\/]+?)(:\d+)?\//
|
---|
[13801] | 833 | if(!m || u =~ /[ \t]+$/)
|
---|
[13551] | 834 | myprintln "* Strange URL '${u}': ${getDescription(j)}"
|
---|
| 835 | else {
|
---|
| 836 | def domain = m[0][1].replaceAll("\\{switch:.*\\}","x")
|
---|
[13554] | 837 | def port = m[0][2]
|
---|
[13551] | 838 | if (!(domain =~ /^\d+\.\d+\.\d+\.\d+$/) && !dv.isValid(domain))
|
---|
| 839 | myprintln "* Strange Domain '${domain}': ${getDescription(j)}"
|
---|
[13554] | 840 | else if (port != null && (port == ":80" || port == ":443")) {
|
---|
| 841 | myprintln "* Useless port '${port}': ${getDescription(j)}"
|
---|
| 842 | }
|
---|
[13551] | 843 | }
|
---|
| 844 | }
|
---|
| 845 |
|
---|
[11420] | 846 | if(josmMirrors.containsKey(url)) {
|
---|
[11964] | 847 | continue
|
---|
[11420] | 848 | }
|
---|
| 849 | if(id == null) {
|
---|
| 850 | myprintln "* No JOSM-ID: ${getDescription(j)}"
|
---|
| 851 | } else if(josmIds.containsKey(id)) {
|
---|
| 852 | myprintln "* JOSM-ID ${id} not unique: ${getDescription(j)}"
|
---|
| 853 | } else {
|
---|
[11964] | 854 | josmIds.put(id, j)
|
---|
[11420] | 855 | }
|
---|
[11572] | 856 | def d = getDate(j)
|
---|
[11573] | 857 | if(!d.isEmpty()) {
|
---|
[11639] | 858 | def reg = (d =~ /^(-|(\d\d\d\d)(-(\d\d)(-(\d\d))?)?)(;(-|(\d\d\d\d)(-(\d\d)(-(\d\d))?)?))?$/)
|
---|
[11572] | 859 | if(reg == null || reg.count != 1) {
|
---|
| 860 | myprintln "* JOSM-Date '${d}' is strange: ${getDescription(j)}"
|
---|
| 861 | } else {
|
---|
| 862 | try {
|
---|
[11964] | 863 | def first = verifyDate(reg[0][2],reg[0][4],reg[0][6])
|
---|
| 864 | def second = verifyDate(reg[0][9],reg[0][11],reg[0][13])
|
---|
[11572] | 865 | if(second.compareTo(first) < 0) {
|
---|
| 866 | myprintln "* JOSM-Date '${d}' is strange (second earlier than first): ${getDescription(j)}"
|
---|
| 867 | }
|
---|
| 868 | }
|
---|
| 869 | catch (Exception e) {
|
---|
| 870 | myprintln "* JOSM-Date '${d}' is strange (${e.getMessage()}): ${getDescription(j)}"
|
---|
| 871 | }
|
---|
| 872 | }
|
---|
[11603] | 873 | }
|
---|
[12261] | 874 | if(getAttributionUrl(j) && !getAttributionText(j)) {
|
---|
| 875 | myprintln "* Attribution link without text: ${getDescription(j)}"
|
---|
| 876 | }
|
---|
| 877 | if(getLogoUrl(j) && !getLogoImage(j)) {
|
---|
| 878 | myprintln "* Logo link without image: ${getDescription(j)}"
|
---|
| 879 | }
|
---|
| 880 | if(getTermsOfUseText(j) && !getTermsOfUseUrl(j)) {
|
---|
| 881 | myprintln "* Terms of Use text without link: ${getDescription(j)}"
|
---|
| 882 | }
|
---|
[11422] | 883 | def js = getShapes(j)
|
---|
| 884 | if(js.size()) {
|
---|
[11964] | 885 | def minlat = 1000
|
---|
| 886 | def minlon = 1000
|
---|
| 887 | def maxlat = -1000
|
---|
| 888 | def maxlon = -1000
|
---|
[11422] | 889 | for(def s: js) {
|
---|
| 890 | for(def p: s.getPoints()) {
|
---|
[11964] | 891 | def lat = p.getLat()
|
---|
| 892 | def lon = p.getLon()
|
---|
| 893 | if(lat > maxlat) maxlat = lat
|
---|
| 894 | if(lon > maxlon) maxlon = lon
|
---|
| 895 | if(lat < minlat) minlat = lat
|
---|
| 896 | if(lon < minlon) minlon = lon
|
---|
[11422] | 897 | }
|
---|
| 898 | }
|
---|
[11964] | 899 | def b = j.getBounds()
|
---|
[11422] | 900 | if(b.getMinLat() != minlat || b.getMinLon() != minlon || b.getMaxLat() != maxlat || b.getMaxLon() != maxlon) {
|
---|
[11423] | 901 | myprintln "* Bounds do not match shape (is ${b.getMinLat()},${b.getMinLon()},${b.getMaxLat()},${b.getMaxLon()}, calculated <bounds min-lat='${minlat}' min-lon='${minlon}' max-lat='${maxlat}' max-lon='${maxlon}'>): ${getDescription(j)}"
|
---|
[11422] | 902 | }
|
---|
| 903 | }
|
---|
[13792] | 904 | def cat = getCategory(j)
|
---|
| 905 | if(cat != null && cat != "photo" && cat != "map" && cat != "historicmap" && cat != "osmbasedmap" && cat != "historicphoto" && cat != "other") {
|
---|
| 906 | myprintln "* Strange category ${cat}: ${getDescription(j)}"
|
---|
| 907 | }
|
---|
[11420] | 908 | }
|
---|
[7726] | 909 | }
|
---|
[9667] | 910 |
|
---|
[7726] | 911 | /**
|
---|
| 912 | * Utility functions that allow uniform access for both ImageryInfo and JsonObject.
|
---|
| 913 | */
|
---|
| 914 | static String getUrl(Object e) {
|
---|
| 915 | if (e instanceof ImageryInfo) return e.url
|
---|
[11412] | 916 | return e.get("properties").getString("url")
|
---|
[7726] | 917 | }
|
---|
[12242] | 918 | static String getUrlStripped(Object e) {
|
---|
| 919 | return getUrl(e).replaceAll("\\?(apikey|access_token)=.*","")
|
---|
| 920 | }
|
---|
[11572] | 921 | static String getDate(Object e) {
|
---|
[11573] | 922 | if (e instanceof ImageryInfo) return e.date ? e.date : ""
|
---|
| 923 | def p = e.get("properties")
|
---|
| 924 | def start = p.containsKey("start_date") ? p.getString("start_date") : ""
|
---|
| 925 | def end = p.containsKey("end_date") ? p.getString("end_date") : ""
|
---|
| 926 | if(!start.isEmpty() && !end.isEmpty())
|
---|
[11572] | 927 | return start+";"+end
|
---|
[11573] | 928 | else if(!start.isEmpty())
|
---|
[11612] | 929 | return start+";-"
|
---|
| 930 | else if(!end.isEmpty())
|
---|
| 931 | return "-;"+end
|
---|
[11964] | 932 | return ""
|
---|
[11572] | 933 | }
|
---|
| 934 | static Date verifyDate(String year, String month, String day) {
|
---|
| 935 | def date
|
---|
[11854] | 936 | if(year == null) {
|
---|
[11572] | 937 | date = "3000-01-01"
|
---|
[11854] | 938 | } else {
|
---|
[11572] | 939 | date = year + "-" + (month == null ? "01" : month) + "-" + (day == null ? "01" : day)
|
---|
[11854] | 940 | }
|
---|
[11572] | 941 | def df = new java.text.SimpleDateFormat("yyyy-MM-dd")
|
---|
| 942 | df.setLenient(false)
|
---|
| 943 | return df.parse(date)
|
---|
| 944 | }
|
---|
[11420] | 945 | static String getId(Object e) {
|
---|
| 946 | if (e instanceof ImageryInfo) return e.getId()
|
---|
| 947 | return e.get("properties").getString("id")
|
---|
| 948 | }
|
---|
[7726] | 949 | static String getName(Object e) {
|
---|
[10517] | 950 | if (e instanceof ImageryInfo) return e.getOriginalName()
|
---|
[11412] | 951 | return e.get("properties").getString("name")
|
---|
[7726] | 952 | }
|
---|
[11967] | 953 | static List<Object> getMirrors(Object e) {
|
---|
| 954 | if (e instanceof ImageryInfo) return e.getMirrors()
|
---|
| 955 | return []
|
---|
| 956 | }
|
---|
[11975] | 957 | static List<Object> getProjections(Object e) {
|
---|
[13530] | 958 | def r = []
|
---|
| 959 | def u = getProjectionsUnstripped(e)
|
---|
| 960 | if(u) {
|
---|
| 961 | for (def p : u) {
|
---|
| 962 | if(!oldproj.containsKey(p) && !("CRS:84".equals(p) && !(getUrlStripped(e) =~ /(?i)version=1\.3/))) {
|
---|
| 963 | r += p
|
---|
| 964 | }
|
---|
| 965 | }
|
---|
| 966 | }
|
---|
| 967 | return r
|
---|
| 968 | }
|
---|
| 969 | static List<Object> getProjectionsUnstripped(Object e) {
|
---|
[11975] | 970 | def r
|
---|
| 971 | if (e instanceof ImageryInfo) {
|
---|
| 972 | r = e.getServerProjections()
|
---|
| 973 | } else {
|
---|
[11981] | 974 | def s = e.get("properties").get("available_projections")
|
---|
| 975 | if (s) {
|
---|
| 976 | r = []
|
---|
[13530] | 977 | for (def p : s) {
|
---|
[11981] | 978 | r += p.getString()
|
---|
[13530] | 979 | }
|
---|
[11981] | 980 | }
|
---|
[11975] | 981 | }
|
---|
| 982 | return r ? r : []
|
---|
| 983 | }
|
---|
[11410] | 984 | static List<Shape> getShapes(Object e) {
|
---|
| 985 | if (e instanceof ImageryInfo) {
|
---|
[11964] | 986 | def bounds = e.getBounds()
|
---|
[11411] | 987 | if(bounds != null) {
|
---|
[11964] | 988 | return bounds.getShapes()
|
---|
[11411] | 989 | }
|
---|
| 990 | return []
|
---|
[11410] | 991 | }
|
---|
[13831] | 992 | def ex = e.get("geometry")
|
---|
| 993 | if (ex != null && !JsonValue.NULL.equals(ex) && !ex.isNull("coordinates")) {
|
---|
| 994 | def poly = ex.get("coordinates")
|
---|
| 995 | List<Shape> l = []
|
---|
| 996 | for(def shapes: poly) {
|
---|
| 997 | def s = new Shape()
|
---|
| 998 | for(def point: shapes) {
|
---|
| 999 | def lon = point[0].toString()
|
---|
| 1000 | def lat = point[1].toString()
|
---|
| 1001 | s.addPoint(lat, lon)
|
---|
[11410] | 1002 | }
|
---|
[13831] | 1003 | l.add(s)
|
---|
[11410] | 1004 | }
|
---|
[13831] | 1005 | return l
|
---|
[11410] | 1006 | }
|
---|
| 1007 | return []
|
---|
| 1008 | }
|
---|
[7726] | 1009 | static String getType(Object e) {
|
---|
| 1010 | if (e instanceof ImageryInfo) return e.getImageryType().getTypeString()
|
---|
[11412] | 1011 | return e.get("properties").getString("type")
|
---|
[7726] | 1012 | }
|
---|
| 1013 | static Integer getMinZoom(Object e) {
|
---|
| 1014 | if (e instanceof ImageryInfo) {
|
---|
[12007] | 1015 | if("wms".equals(getType(e)) && e.getName() =~ / mirror/)
|
---|
[13792] | 1016 | return null
|
---|
[7726] | 1017 | int mz = e.getMinZoom()
|
---|
| 1018 | return mz == 0 ? null : mz
|
---|
| 1019 | } else {
|
---|
[11412] | 1020 | def num = e.get("properties").getJsonNumber("min_zoom")
|
---|
[7726] | 1021 | if (num == null) return null
|
---|
| 1022 | return num.intValue()
|
---|
| 1023 | }
|
---|
| 1024 | }
|
---|
| 1025 | static Integer getMaxZoom(Object e) {
|
---|
| 1026 | if (e instanceof ImageryInfo) {
|
---|
[12007] | 1027 | if("wms".equals(getType(e)) && e.getName() =~ / mirror/)
|
---|
[13792] | 1028 | return null
|
---|
[7726] | 1029 | int mz = e.getMaxZoom()
|
---|
| 1030 | return mz == 0 ? null : mz
|
---|
| 1031 | } else {
|
---|
[11412] | 1032 | def num = e.get("properties").getJsonNumber("max_zoom")
|
---|
[7726] | 1033 | if (num == null) return null
|
---|
| 1034 | return num.intValue()
|
---|
| 1035 | }
|
---|
| 1036 | }
|
---|
| 1037 | static String getCountryCode(Object e) {
|
---|
| 1038 | if (e instanceof ImageryInfo) return "".equals(e.getCountryCode()) ? null : e.getCountryCode()
|
---|
[11412] | 1039 | return e.get("properties").getString("country_code", null)
|
---|
[7726] | 1040 | }
|
---|
[9505] | 1041 | static String getQuality(Object e) {
|
---|
[11575] | 1042 | if (e instanceof ImageryInfo) return e.isBestMarked() ? "eli-best" : null
|
---|
[11603] | 1043 | return (e.get("properties").containsKey("best")
|
---|
| 1044 | && e.get("properties").getBoolean("best")) ? "eli-best" : null
|
---|
[9505] | 1045 | }
|
---|
[13536] | 1046 | static Boolean getOverlay(Object e) {
|
---|
| 1047 | if (e instanceof ImageryInfo) return e.isOverlay()
|
---|
| 1048 | return (e.get("properties").containsKey("overlay")
|
---|
| 1049 | && e.get("properties").getBoolean("overlay"))
|
---|
| 1050 | }
|
---|
[11420] | 1051 | static String getIcon(Object e) {
|
---|
| 1052 | if (e instanceof ImageryInfo) return e.getIcon()
|
---|
| 1053 | return e.get("properties").getString("icon", null)
|
---|
| 1054 | }
|
---|
[11975] | 1055 | static String getAttributionText(Object e) {
|
---|
| 1056 | if (e instanceof ImageryInfo) return e.getAttributionText(0, null, null)
|
---|
| 1057 | try {return e.get("properties").get("attribution").getString("text", null)} catch (NullPointerException ex) {return null}
|
---|
| 1058 | }
|
---|
| 1059 | static String getAttributionUrl(Object e) {
|
---|
| 1060 | if (e instanceof ImageryInfo) return e.getAttributionLinkURL()
|
---|
| 1061 | try {return e.get("properties").get("attribution").getString("url", null)} catch (NullPointerException ex) {return null}
|
---|
| 1062 | }
|
---|
| 1063 | static String getTermsOfUseText(Object e) {
|
---|
| 1064 | if (e instanceof ImageryInfo) return e.getTermsOfUseText()
|
---|
| 1065 | return null
|
---|
| 1066 | }
|
---|
| 1067 | static String getTermsOfUseUrl(Object e) {
|
---|
| 1068 | if (e instanceof ImageryInfo) return e.getTermsOfUseURL()
|
---|
| 1069 | return null
|
---|
| 1070 | }
|
---|
[13792] | 1071 | static String getCategory(Object e) {
|
---|
| 1072 | if (e instanceof ImageryInfo) {
|
---|
| 1073 | return e.getImageryCategoryOriginalString()
|
---|
| 1074 | }
|
---|
| 1075 | return null
|
---|
| 1076 | }
|
---|
[12261] | 1077 | static String getLogoImage(Object e) {
|
---|
| 1078 | if (e instanceof ImageryInfo) return e.getAttributionImageRaw()
|
---|
| 1079 | return null
|
---|
| 1080 | }
|
---|
| 1081 | static String getLogoUrl(Object e) {
|
---|
| 1082 | if (e instanceof ImageryInfo) return e.getAttributionImageURL()
|
---|
| 1083 | return null
|
---|
| 1084 | }
|
---|
[11975] | 1085 | static String getPermissionReferenceUrl(Object e) {
|
---|
| 1086 | if (e instanceof ImageryInfo) return e.getPermissionReferenceURL()
|
---|
| 1087 | return e.get("properties").getString("license_url", null)
|
---|
| 1088 | }
|
---|
| 1089 | static Map<String,String> getDescriptions(Object e) {
|
---|
| 1090 | Map<String,String> res = new HashMap<String, String>()
|
---|
| 1091 | if (e instanceof ImageryInfo) {
|
---|
| 1092 | String a = e.getDescription()
|
---|
| 1093 | if (a) res.put("en", a)
|
---|
| 1094 | } else {
|
---|
| 1095 | String a = e.get("properties").getString("description", null)
|
---|
| 1096 | if (a) res.put("en", a)
|
---|
| 1097 | }
|
---|
| 1098 | return res
|
---|
| 1099 | }
|
---|
| 1100 | static Boolean getValidGeoreference(Object e) {
|
---|
| 1101 | if (e instanceof ImageryInfo) return e.isGeoreferenceValid()
|
---|
| 1102 | return false
|
---|
| 1103 | }
|
---|
[12226] | 1104 | static Boolean getDefault(Object e) {
|
---|
| 1105 | if (e instanceof ImageryInfo) return e.isDefaultEntry()
|
---|
| 1106 | return e.get("properties").getBoolean("default", false)
|
---|
| 1107 | }
|
---|
[7726] | 1108 | String getDescription(Object o) {
|
---|
| 1109 | def url = getUrl(o)
|
---|
| 1110 | def cc = getCountryCode(o)
|
---|
| 1111 | if (cc == null) {
|
---|
| 1112 | def j = josmUrls.get(url)
|
---|
| 1113 | if (j != null) cc = getCountryCode(j)
|
---|
| 1114 | if (cc == null) {
|
---|
[11582] | 1115 | def e = eliUrls.get(url)
|
---|
[7726] | 1116 | if (e != null) cc = getCountryCode(e)
|
---|
| 1117 | }
|
---|
| 1118 | }
|
---|
| 1119 | if (cc == null) {
|
---|
| 1120 | cc = ''
|
---|
| 1121 | } else {
|
---|
| 1122 | cc = "[$cc] "
|
---|
| 1123 | }
|
---|
| 1124 | def d = cc + getName(o) + " - " + getUrl(o)
|
---|
| 1125 | if (options.shorten) {
|
---|
| 1126 | def MAXLEN = 140
|
---|
| 1127 | if (d.length() > MAXLEN) d = d.substring(0, MAXLEN-1) + "..."
|
---|
| 1128 | }
|
---|
| 1129 | return d
|
---|
| 1130 | }
|
---|
| 1131 | }
|
---|