Changeset 9658 in josm
- Timestamp:
- 2016-01-27T22:27:54+01:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/sync_editor_imagery_index.groovy
r9653 r9658 45 45 46 46 static def options 47 47 48 48 /** 49 49 * Main method. … … 53 53 def script = new sync_editor_imagery_index() 54 54 script.loadSkip() 55 script.start() 55 56 script.loadJosmEntries() 56 57 script.loadEIIEntries() 57 58 script.checkInOneButNotTheOther() 58 59 script.checkCommonEntries() 60 script.end() 59 61 if(outputStream != null) { 60 62 outputStream.close(); … … 69 71 */ 70 72 static void parse_command_line_arguments(args) { 71 def cli = new CliBuilder( )73 def cli = new CliBuilder(width: 160) 72 74 cli.o(longOpt:'output', args:1, argName: "output", "Output file, - prints to stdout (default: -)") 73 75 cli.e(longOpt:'eii_input', args:1, argName:"eii_input", "Input file for the editor imagery index (json). Default is $eiiInputFile (current directory).") … … 75 77 cli.s(longOpt:'shorten', "shorten the output, so it is easier to read in a console window") 76 78 cli.n(longOpt:'noskip', argName:"noskip", "don't skip known entries") 79 cli.x(longOpt:'xhtmlbody', argName:"xhtmlbody", "create XHTML body for display in a web page") 80 cli.X(longOpt:'xhtml', argName:"xhtml", "create XHTML for display in a web page") 77 81 cli.m(longOpt:'nomissingeii', argName:"nomissingeii", "don't show missing editor imagery index entries") 78 82 cli.h(longOpt:'help', "show this help") … … 99 103 return; 100 104 /* TMS proxies for our wms */ 101 skipEntries[" Czech CUZK:KM tiles proxy - http://osm-{switch:a,b,c}.zby.cz/tiles_cuzk.php/{zoom}/{x}/{y}.png"] = 1102 skipEntries[" [CH] Stadt Zürich Luftbild 2011 - http://mapproxy.sosm.ch:8080/tiles/zh_luftbild2011/EPSG900913/{z}/{x}/{y}.png?origin=nw"] = 1103 skipEntries[" [CH] Übersichtsplan Zürich - http://mapproxy.sosm.ch:8080/tiles/zh_uebersichtsplan/EPSG900913/{zoom}/{x}/{y}.png?origin=nw"] = 1104 skipEntries[" [CH] Kanton Solothurn 25cm (SOGIS 2011-2014) - http://mapproxy.osm.ch:8080/tiles/sogis2014/EPSG900913/{z}/{x}/{y}.png?origin=nw"] = 1105 skipEntries["- Czech CUZK:KM tiles proxy - http://osm-{switch:a,b,c}.zby.cz/tiles_cuzk.php/{zoom}/{x}/{y}.png"] = 1 106 skipEntries["- [CH] Stadt Zürich Luftbild 2011 - http://mapproxy.sosm.ch:8080/tiles/zh_luftbild2011/EPSG900913/{z}/{x}/{y}.png?origin=nw"] = 1 107 skipEntries["- [CH] Übersichtsplan Zürich - http://mapproxy.sosm.ch:8080/tiles/zh_uebersichtsplan/EPSG900913/{zoom}/{x}/{y}.png?origin=nw"] = 1 108 skipEntries["- [CH] Kanton Solothurn 25cm (SOGIS 2011-2014) - http://mapproxy.osm.ch:8080/tiles/sogis2014/EPSG900913/{z}/{x}/{y}.png?origin=nw"] = 1 105 109 /* URL style mismatch */ 106 110 skipEntries["+++ EII-URL uses {z} instead of {zoom}: http://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg"] = 1 … … 116 120 117 121 skipEntries["+++ EII-URL is not unique: http://geolittoral.application.equipement.gouv.fr/wms/metropole?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=ortholittorale&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 118 skipEntries[" Streets NRW Geofabrik.de - http://tools.geofabrik.de/osmi/view/strassennrw/wxs?REQUEST=GetMap&SERVICE=wms&VERSION=1.1.1&FORMAT=image/png&SRS={proj}&STYLES=&LAYERS=unzugeordnete_strassen,kreisstrassen_ast,kreisstrassen,landesstrassen_ast,landesstrassen,bundesstrassen_ast,bundesstrassen,autobahnen_ast,autobahnen,endpunkte&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1119 skipEntries[" Czech UHUL:ORTOFOTO - http://geoportal2.uhul.cz/cgi-bin/oprl.asp?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS={proj}&LAYERS=Ortofoto_cb&STYLES=default&FORMAT=image/jpeg&TRANSPARENT=TRUE&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1120 skipEntries[" Czech ÚHUL:ORTOFOTO tiles proxy - http://osm-{switch:a,b,c}.zby.cz/tiles_uhul.php/{zoom}/{x}/{y}.jpg"] = 1121 skipEntries[" [CH] Kanton Solothurn 25cm (SOGIS 2011-2014) - http://www.sogis1.so.ch/cgi-bin/sogis/sogis_orthofoto.wms?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=Orthofoto_SO&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1122 skipEntries[" [CH] Kanton Solothurn Infrarot 12.5cm (SOGIS 2011) - http://www.sogis1.so.ch/cgi-bin/sogis/sogis_ortho.wms?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=Orthofoto11_CIR&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1123 skipEntries[" [CH] Stadt Bern 10cm/25cm (2008) - http://map.bern.ch/arcgis/services/Orthofoto_2008/MapServer/WMSServer?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=0,1&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1124 skipEntries[" [EE] Estonia Basemap (Maaamet) - http://kaart.maaamet.ee/wms/alus-geo?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=pohi_vr2&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1125 skipEntries[" [EE] Estonia Forestry (Maaamet) - http://kaart.maaamet.ee/wms/alus-geo?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=cir_ngr&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1126 skipEntries[" [EE] Estonia Hillshading (Maaamet) - http://kaart.maaamet.ee/wms/alus-geo?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=reljeef&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1127 skipEntries[" [EE] Estonia Ortho (Maaamet) - http://kaart.maaamet.ee/wms/alus-geo?VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000&SRS={proj}&FORMAT=image/jpeg&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1128 skipEntries[" Hamburg (DK5) - http://gateway.hamburg.de/OGCFassade/HH_WMS_Geobasisdaten.aspx?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=1&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1129 skipEntries[" Hamburg (40 cm) - http://gateway.hamburg.de/OGCFassade/HH_WMS_DOP40.aspx?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=0&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1122 skipEntries["- Streets NRW Geofabrik.de - http://tools.geofabrik.de/osmi/view/strassennrw/wxs?REQUEST=GetMap&SERVICE=wms&VERSION=1.1.1&FORMAT=image/png&SRS={proj}&STYLES=&LAYERS=unzugeordnete_strassen,kreisstrassen_ast,kreisstrassen,landesstrassen_ast,landesstrassen,bundesstrassen_ast,bundesstrassen,autobahnen_ast,autobahnen,endpunkte&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 123 skipEntries["- Czech UHUL:ORTOFOTO - http://geoportal2.uhul.cz/cgi-bin/oprl.asp?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS={proj}&LAYERS=Ortofoto_cb&STYLES=default&FORMAT=image/jpeg&TRANSPARENT=TRUE&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 124 skipEntries["- Czech ÚHUL:ORTOFOTO tiles proxy - http://osm-{switch:a,b,c}.zby.cz/tiles_uhul.php/{zoom}/{x}/{y}.jpg"] = 1 125 skipEntries["- [CH] Kanton Solothurn 25cm (SOGIS 2011-2014) - http://www.sogis1.so.ch/cgi-bin/sogis/sogis_orthofoto.wms?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=Orthofoto_SO&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 126 skipEntries["- [CH] Kanton Solothurn Infrarot 12.5cm (SOGIS 2011) - http://www.sogis1.so.ch/cgi-bin/sogis/sogis_ortho.wms?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=Orthofoto11_CIR&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 127 skipEntries["- [CH] Stadt Bern 10cm/25cm (2008) - http://map.bern.ch/arcgis/services/Orthofoto_2008/MapServer/WMSServer?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=0,1&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 128 skipEntries["- [EE] Estonia Basemap (Maaamet) - http://kaart.maaamet.ee/wms/alus-geo?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=pohi_vr2&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 129 skipEntries["- [EE] Estonia Forestry (Maaamet) - http://kaart.maaamet.ee/wms/alus-geo?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=cir_ngr&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 130 skipEntries["- [EE] Estonia Hillshading (Maaamet) - http://kaart.maaamet.ee/wms/alus-geo?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=reljeef&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 131 skipEntries["- [EE] Estonia Ortho (Maaamet) - http://kaart.maaamet.ee/wms/alus-geo?VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000&SRS={proj}&FORMAT=image/jpeg&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 132 skipEntries["- Hamburg (DK5) - http://gateway.hamburg.de/OGCFassade/HH_WMS_Geobasisdaten.aspx?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=1&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 133 skipEntries["- Hamburg (40 cm) - http://gateway.hamburg.de/OGCFassade/HH_WMS_DOP40.aspx?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=0&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 1 130 134 skipEntries[" name differs: http://wms.openstreetmap.fr/tms/1.0.0/tours_2013/{zoom}/{x}/{y}"] = 3 131 135 skipEntries[" name differs: http://wms.openstreetmap.fr/tms/1.0.0/tours/{zoom}/{x}/{y}"] = 3 … … 135 139 skipEntries[" name differs: http://ooc.openstreetmap.org/os1/{zoom}/{x}/{y}.jpg"] = 3 136 140 skipEntries[" name differs: http://www.gisnet.lv/cgi-bin/osm_latvia?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=piekraste&SRS={proj}&WIDTH={width}&height={height}&BBOX={bbox}"] = 3 137 skipEntries[" name differs: http://tms.cadastre.openstreetmap.fr/*/tout/{z }/{x}/{y}.png"] = 3141 skipEntries[" name differs: http://tms.cadastre.openstreetmap.fr/*/tout/{zoom}/{x}/{y}.png"] = 3 138 142 skipEntries[" name differs: http://{switch:a,b,c}.tiles.mapbox.com/v4/enf.e0b8291e/{zoom}/{x}/{y}.png?access_token=pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJhNVlHd29ZIn0.ti6wATGDWOmCnCYen-Ip7Q"] = 3 139 143 skipEntries[" name differs: http://geo.nls.uk/mapdata2/os/25_inch/scotland_1/{zoom}/{x}/{y}.png"] = 3 140 144 skipEntries[" name differs: http://geo.nls.uk/mapdata3/os/6_inch_gb_1900/{zoom}/{x}/{y}.png"] = 3 141 skipEntries[" maxzoom differs: [DE] Bavaria (2 m) - http://geodaten.bayern.de/ogc/ogc_dop200_oa.cgi?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=adv_dop200c&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 3142 145 skipEntries[" name differs: http://geoserver.infobex.hu/Budapest2014/IST/{zoom}/{x}/{y}.jpg"] = 3 143 146 skipEntries[" name differs: http://mapproxy.openmap.lt/ort10lt/g/{zoom}/{x}/{y}.jpeg"] = 3 144 147 skipEntries[" name differs: http://e.tile.openstreetmap.hu/ortofoto2000/{zoom}/{x}/{y}.jpg"] = 3 145 skipEntries[" name differs: http://tms.cadastre.openstreetmap.fr/*/tout/{zoom}/{x}/{y}.png"] = 3148 skipEntries[" maxzoom differs: [DE] Bavaria (2 m) - http://geodaten.bayern.de/ogc/ogc_dop200_oa.cgi?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&Layers=adv_dop200c&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}"] = 3 146 149 skipEntries[" minzoom differs: [AU] LPI NSW Administrative Boundaries County - http://maps.six.nsw.gov.au/arcgis/services/public/NSW_Administrative_Boundaries/MapServer/WMSServer?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS={proj}&BBOX={bbox}&WIDTH={width}&HEIGHT={height}&LAYERS=County&STYLES=&FORMAT=image/png32&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE"] = 3 147 150 skipEntries[" minzoom differs: [AU] LPI NSW Administrative Boundaries NPWS Reserve - http://maps.six.nsw.gov.au/arcgis/services/public/NSW_Administrative_Boundaries/MapServer/WMSServer?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS={proj}&BBOX={bbox}&WIDTH={width}&HEIGHT={height}&LAYERS=NPWSReserve&STYLES=&FORMAT=image/png32&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE"] = 3 … … 156 159 } 157 160 158 void myprintln(String s) { 159 if(skipEntries.containsKey(s)) { 160 skipCount = skipEntries.get(s) 161 } 162 if(skipCount) { 163 skipCount -= 1; 164 return 165 } 161 void myprintlnfinal(String s) { 166 162 if(outputStream != null) { 167 163 outputStream.write(s); … … 169 165 } else { 170 166 println s; 167 } 168 } 169 170 void myprintln(String s) { 171 if(skipEntries.containsKey(s)) { 172 skipCount = skipEntries.get(s) 173 skipEntries.remove(s) 174 } 175 if(skipCount) { 176 skipCount -= 1; 177 if(options.xhtmlbody || options.xhtml) { 178 s = "<pre style=\"margin:3px;color:green\">"+s.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")+"</pre>" 179 } else { 180 return 181 } 182 } else if(options.xhtmlbody || options.xhtml) { 183 String color = s.startsWith("***") ? "black" : (s.startsWith("+ ") ? "blue" : "red") 184 s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")+"</pre>" 185 } 186 myprintlnfinal(s) 187 } 188 189 void start() { 190 if (options.xhtml) { 191 myprintlnfinal "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n" 192 myprintlnfinal "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/><title>JOSM - EII differences</title></head><body>\n" 193 } 194 } 195 196 void end() { 197 for (def s: skipEntries.keySet()) { 198 myprintln "+++ Obsolete skip entry: " + s 199 } 200 if (options.xhtml) { 201 myprintlnfinal "</body></html>\n" 171 202 } 172 203 } … … 199 230 for (def e : josmEntries) { 200 231 def url = getUrl(e) 232 if (url.contains("{z}")) { 233 myprintln "+++ JOSM-URL uses {z} instead of {zoom}: "+url 234 url = url.replace("{z}","{zoom}") 235 } 201 236 if (josmUrls.containsKey(url)) { 202 237 myprintln "+++ JOSM-URL is not unique: "+url 203 238 } else { 204 239 josmUrls.put(url, e) 240 } 241 for (def m : e.getMirrors()) { 242 url = getUrl(m) 243 if (josmUrls.containsKey(url)) { 244 myprintln "+++ JOSM-Mirror-URL is not unique: "+url 245 } else { 246 josmUrls.put(url, m) 247 } 205 248 } 206 249 } … … 222 265 def l1 = inOneButNotTheOther(eiiUrls, josmUrls) 223 266 myprintln "*** URLs found in EII but not in JOSM (${l1.size()}): ***" 224 if (l1.isEmpty()) { 225 myprintln " -" 226 } else { 267 if (!l1.isEmpty()) { 227 268 for (def l : l1) 228 myprintln l269 myprintln "-"+l 229 270 } 230 271 … … 233 274 def l2 = inOneButNotTheOther(josmUrls, eiiUrls) 234 275 myprintln "*** URLs found in JOSM but not in EII (${l2.size()}): ***" 235 if (l2.isEmpty()) { 236 myprintln " -" 237 } else { 276 if (!l2.isEmpty()) { 238 277 for (def l : l2) 239 myprintln l278 myprintln "+" + l 240 279 } 241 280 } -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r9619 r9658 145 145 } 146 146 } 147 148 147 149 148 /** original name of the imagery entry in case of translation call, for multiple languages English when possible */ … … 186 185 /** country code of the imagery (for country specific imagery) */ 187 186 private String countryCode = ""; 187 /** mirrors of different type for this entry */ 188 private List<ImageryInfo> mirrors = null; 188 189 /** icon used in menu */ 189 190 private String icon; … … 1029 1030 } 1030 1031 1032 /** 1033 * Adds a mirror entry. Mirror entries are completed with the data from the master entry 1034 * and only describe another method to access identical data. 1035 * 1036 * @param entry the mirror to be added 1037 * @since 9658 1038 */ 1039 public void addMirror(ImageryInfo entry) { 1040 if (mirrors == null) { 1041 mirrors = new ArrayList<>(); 1042 } 1043 mirrors.add(entry); 1044 } 1045 1046 /** 1047 * Returns the mirror entries. Entries are completed with master entry data. 1048 * 1049 * @return the list of mirrors 1050 * @since 9658 1051 */ 1052 public List<ImageryInfo> getMirrors() { 1053 List<ImageryInfo> l = new ArrayList<>(); 1054 if (mirrors != null) { 1055 for (ImageryInfo i : mirrors) { 1056 ImageryInfo n = new ImageryInfo(this); 1057 if (i.defaultMaxZoom != 0) { 1058 n.defaultMaxZoom = i.defaultMaxZoom; 1059 } 1060 if (i.defaultMinZoom != 0) { 1061 n.defaultMinZoom = i.defaultMinZoom; 1062 } 1063 if (i.serverProjections != null) { 1064 n.serverProjections = i.serverProjections; 1065 } 1066 n.url = i.url; 1067 n.imageryType = i.imageryType; 1068 if (i.getTileSize() != 0) { 1069 n.setTileSize(i.getTileSize()); 1070 } 1071 l.add(n); 1072 } 1073 } 1074 return l; 1075 } 1031 1076 } -
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r9619 r9658 40 40 ENTRY, // inside an entry 41 41 ENTRY_ATTRIBUTE, // note we are inside an entry attribute to collect the character data 42 PROJECTIONS, 42 PROJECTIONS, // inside projections block of an entry 43 MIRROR, // inside an mirror entry 44 MIRROR_ATTRIBUTE, // note we are inside an mirror attribute to collect the character data 45 MIRROR_PROJECTIONS, // inside projections block of an mirror entry 43 46 CODE, 44 47 BOUNDS, … … 89 92 90 93 private ImageryInfo entry; 94 /** In case of mirror parsing this contains the mirror entry */ 95 private ImageryInfo mirrorEntry; 91 96 private ImageryBounds bounds; 92 97 private Shape shape; … … 130 135 noTileChecksums = new HashMap<>(); 131 136 metadataHeaders = new HashMap<>(); 137 } 138 break; 139 case MIRROR: 140 if (Arrays.asList(new String[] { 141 "type", 142 "url", 143 "min-zoom", 144 "max-zoom", 145 "tile-size", 146 }).contains(qName)) { 147 newState = State.MIRROR_ATTRIBUTE; 148 lang = atts.getValue("lang"); 149 } else if ("projections".equals(qName)) { 150 projections = new ArrayList<>(); 151 newState = State.MIRROR_PROJECTIONS; 132 152 } 133 153 break; … … 171 191 projections = new ArrayList<>(); 172 192 newState = State.PROJECTIONS; 193 } else if ("mirror".equals(qName)) { 194 projections = new ArrayList<>(); 195 newState = State.MIRROR; 196 mirrorEntry = new ImageryInfo(); 173 197 } else if ("no-tile-header".equals(qName)) { 174 198 String name = atts.getValue("name"); … … 214 238 break; 215 239 case PROJECTIONS: 240 case MIRROR_PROJECTIONS: 216 241 if ("code".equals(qName)) { 217 242 newState = State.CODE; … … 259 284 } 260 285 break; 286 case MIRROR: 287 if ("mirror".equals(qName)) { 288 if (mirrorEntry != null) { 289 entry.addMirror(mirrorEntry); 290 mirrorEntry = null; 291 } 292 } 293 break; 294 case MIRROR_ATTRIBUTE: 295 if (mirrorEntry != null) { 296 switch(qName) { 297 case "type": 298 boolean found = false; 299 for (ImageryType type : ImageryType.values()) { 300 if (Objects.equals(accumulator.toString(), type.getTypeString())) { 301 mirrorEntry.setImageryType(type); 302 found = true; 303 break; 304 } 305 } 306 if (!found) { 307 mirrorEntry = null; 308 } 309 break; 310 case "url": 311 mirrorEntry.setUrl(accumulator.toString()); 312 break; 313 case "min-zoom": 314 case "max-zoom": 315 Integer val = null; 316 try { 317 val = Integer.valueOf(accumulator.toString()); 318 } catch (NumberFormatException e) { 319 val = null; 320 } 321 if (val == null) { 322 mirrorEntry = null; 323 } else { 324 if ("min-zoom".equals(qName)) { 325 mirrorEntry.setDefaultMinZoom(val); 326 } else { 327 mirrorEntry.setDefaultMaxZoom(val); 328 } 329 } 330 break; 331 case "tile-size": 332 Integer tileSize = null; 333 try { 334 tileSize = Integer.valueOf(accumulator.toString()); 335 } catch (NumberFormatException e) { 336 tileSize = null; 337 } 338 if (tileSize == null) { 339 mirrorEntry = null; 340 } else { 341 entry.setTileSize(tileSize.intValue()); 342 } 343 break; 344 } 345 } 346 break; 261 347 case ENTRY_ATTRIBUTE: 262 348 switch(qName) { … … 379 465 projections = null; 380 466 break; 467 case MIRROR_PROJECTIONS: 468 mirrorEntry.setServerProjections(projections); 469 projections = null; 470 break; 471 /* nothing to do for these or the unknown type: 381 472 case NO_TILE: 382 break; 383 473 case NO_TILESUM: 474 case METADATA: 475 case UNKNOWN: 476 break; 477 */ 384 478 } 385 479 }
Note:
See TracChangeset
for help on using the changeset viewer.