Changeset 7012 in josm for trunk/src/org/openstreetmap/josm/io/imagery
- Timestamp:
- 2014-04-27T15:35:47+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/imagery
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r7005 r7012 98 98 switch (states.peek()) { 99 99 case INIT: 100 if ( qName.equals("imagery")) {100 if ("imagery".equals(qName)) { 101 101 newState = State.IMAGERY; 102 102 } 103 103 break; 104 104 case IMAGERY: 105 if ( qName.equals("entry")) {105 if ("entry".equals(qName)) { 106 106 entry = new ImageryInfo(); 107 107 skipEntry = false; … … 128 128 }).contains(qName)) { 129 129 newState = State.ENTRY_ATTRIBUTE; 130 } else if ( qName.equals("bounds")) {130 } else if ("bounds".equals(qName)) { 131 131 try { 132 132 bounds = new ImageryBounds( … … 139 139 } 140 140 newState = State.BOUNDS; 141 } else if ( qName.equals("projections")) {141 } else if ("projections".equals(qName)) { 142 142 projections = new ArrayList<>(); 143 143 newState = State.PROJECTIONS; … … 145 145 break; 146 146 case BOUNDS: 147 if ( qName.equals("shape")) {147 if ("shape".equals(qName)) { 148 148 shape = new Shape(); 149 149 newState = State.SHAPE; … … 151 151 break; 152 152 case SHAPE: 153 if ( qName.equals("point")) {153 if ("point".equals(qName)) { 154 154 try { 155 155 shape.addPoint(atts.getValue("lat"), atts.getValue("lon")); … … 160 160 break; 161 161 case PROJECTIONS: 162 if ( qName.equals("code")) {162 if ("code".equals(qName)) { 163 163 newState = State.CODE; 164 164 } … … 192 192 throw new RuntimeException("parsing error: more closing than opening elements"); 193 193 case ENTRY: 194 if ( qName.equals("entry")) {194 if ("entry".equals(qName)) { 195 195 if (!skipEntry) { 196 196 entries.add(entry); … … 200 200 break; 201 201 case ENTRY_ATTRIBUTE: 202 if (qName.equals("name")) { 202 switch(qName) { 203 case "name": 203 204 entry.setTranslatedName(accumulator.toString()); 204 } else if (qName.equals("type")) { 205 break; 206 case "type": 205 207 boolean found = false; 206 208 for (ImageryType type : ImageryType.values()) { … … 214 216 skipEntry = true; 215 217 } 216 } else if (qName.equals("default")) { 217 if (accumulator.toString().equals("true")) { 218 break; 219 case "default": 220 switch (accumulator.toString()) { 221 case "true": 218 222 entry.setDefaultEntry(true); 219 } else if (accumulator.toString().equals("false")) { 223 break; 224 case "false": 220 225 entry.setDefaultEntry(false); 221 } else { 226 break; 227 default: 222 228 skipEntry = true; 223 229 } 224 } else if (qName.equals("url")) { 230 break; 231 case "url": 225 232 entry.setUrl(accumulator.toString()); 226 } else if (qName.equals("eula")) { 233 break; 234 case "eula": 227 235 entry.setEulaAcceptanceRequired(accumulator.toString()); 228 } else if (qName.equals("min-zoom") || qName.equals("max-zoom")) { 236 break; 237 case "min-zoom": 238 case "max-zoom": 229 239 Integer val = null; 230 240 try { … … 236 246 skipEntry = true; 237 247 } else { 238 if ( qName.equals("min-zoom")) {248 if ("min-zoom".equals(qName)) { 239 249 entry.setDefaultMinZoom(val); 240 250 } else { … … 242 252 } 243 253 } 244 } else if (qName.equals("attribution-text")) { 254 break; 255 case "attribution-text": 245 256 entry.setAttributionText(accumulator.toString()); 246 } else if (qName.equals("attribution-url")) { 257 break; 258 case "attribution-url": 247 259 entry.setAttributionLinkURL(accumulator.toString()); 248 } else if (qName.equals("logo-image")) { 260 break; 261 case "logo-image": 249 262 entry.setAttributionImage(accumulator.toString()); 250 } else if (qName.equals("logo-url")) { 263 break; 264 case "logo-url": 251 265 entry.setAttributionImageURL(accumulator.toString()); 252 } else if (qName.equals("terms-of-use-text")) { 266 break; 267 case "terms-of-use-text": 253 268 entry.setTermsOfUseText(accumulator.toString()); 254 } else if (qName.equals("terms-of-use-url")) { 269 break; 270 case "terms-of-use-url": 255 271 entry.setTermsOfUseURL(accumulator.toString()); 256 } else if (qName.equals("country-code")) { 272 break; 273 case "country-code": 257 274 entry.setCountryCode(accumulator.toString()); 258 } else if (qName.equals("icon")) { 275 break; 276 case "icon": 259 277 entry.setIcon(accumulator.toString()); 278 break; 260 279 } 261 280 break; -
trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java
r7005 r7012 92 92 e = ne.lon(); 93 93 } 94 if ( myProj.equals("EPSG:4326") && !info.getServerProjections().contains(myProj) && info.getServerProjections().contains("CRS:84")) {94 if ("EPSG:4326".equals(myProj) && !info.getServerProjections().contains(myProj) && info.getServerProjections().contains("CRS:84")) { 95 95 myProj = "CRS:84"; 96 96 } … … 114 114 if (baseURL.toLowerCase().contains("crs=epsg:4326")) { 115 115 switchLatLon = true; 116 } else if (baseURL.toLowerCase().contains("crs=") && myProj.equals("EPSG:4326")) {116 } else if (baseURL.toLowerCase().contains("crs=") && "EPSG:4326".equals(myProj)) { 117 117 switchLatLon = true; 118 118 }
Note:
See TracChangeset
for help on using the changeset viewer.