Changeset 18382 in josm for trunk/scripts/SyncEditorLayerIndex.java
- Timestamp:
- 2022-02-18T08:34:05+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.java
r18211 r18382 308 308 ((s.startsWith("+ ") || s.startsWith("+++ ELI")) ? "blue" : 309 309 (s.startsWith("#") ? "indigo" : 310 (s.startsWith("!") ? "orange" : "red"))); 310 (s.startsWith("!") ? "orange" : 311 (s.startsWith("~") ? "red" : "brown")))); 311 312 s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">")+"</pre>"; 312 313 } … … 503 504 for (ImageryInfo e : josmEntries) { 504 505 if (isBlank(getUrl(e))) { 505 myprintln(" +++JOSM-Entry without URL: " + getDescription(e));506 myprintln("~~~ JOSM-Entry without URL: " + getDescription(e)); 506 507 continue; 507 508 } 508 509 if (isBlank(e.getDate()) && e.getDate() != null) { 509 myprintln(" +++JOSM-Entry with empty Date: " + getDescription(e));510 myprintln("~~~ JOSM-Entry with empty Date: " + getDescription(e)); 510 511 continue; 511 512 } 512 513 if (isBlank(getName(e))) { 513 myprintln(" +++JOSM-Entry without Name: " + getDescription(e));514 myprintln("~~~ JOSM-Entry without Name: " + getDescription(e)); 514 515 continue; 515 516 } 516 517 String url = getUrlStripped(e); 517 518 if (url.contains("{z}")) { 518 myprintln(" +++JOSM-URL uses {z} instead of {zoom}: "+getDescription(e));519 myprintln("~~~ JOSM-URL uses {z} instead of {zoom}: "+getDescription(e)); 519 520 url = url.replace("{z}", "{zoom}"); 520 521 } 521 522 if (josmUrls.containsKey(url)) { 522 myprintln(" +++JOSM-URL is not unique: "+url);523 myprintln("~~~ JOSM-URL is not unique: "+url); 523 524 } else { 524 525 josmUrls.put(url, e); … … 530 531 origNameField.set(m, m.getOriginalName().replaceAll(" mirror server( \\d+)?", "")); 531 532 if (josmUrls.containsKey(url)) { 532 myprintln(" +++JOSM-Mirror-URL is not unique: "+url);533 myprintln("~~~ JOSM-Mirror-URL is not unique: "+url); 533 534 } else { 534 535 josmUrls.put(url, m); … … 978 979 List<Coordinate> p = shape.getPoints(); 979 980 if (!p.get(0).equals(p.get(p.size()-1))) { 980 myprintln(" +++JOSM shape "+num+" unclosed: "+getDescription(j));981 myprintln("~~~ JOSM shape "+num+" unclosed: "+getDescription(j)); 981 982 } 982 983 for (int nump = 1; nump < p.size(); ++nump) { 983 984 if (Objects.equals(p.get(nump-1), p.get(nump))) { 984 myprintln(" +++JOSM shape "+num+" double point at "+(nump-1)+": "+getDescription(j));985 myprintln("~~~ JOSM shape "+num+" double point at "+(nump-1)+": "+getDescription(j)); 985 986 } 986 987 } … … 1168 1169 String urlLc = url.toLowerCase(Locale.ENGLISH); 1169 1170 if (getProjections(j).isEmpty()) { 1170 myprintln(" *WMS without projections: "+getDescription(j));1171 myprintln("~ WMS without projections: "+getDescription(j)); 1171 1172 } else { 1172 1173 List<String> unsupported = new LinkedList<>(); … … 1175 1176 if ("CRS:84".equals(p)) { 1176 1177 if (!urlLc.contains("version=1.3")) { 1177 myprintln(" *CRS:84 without WMS 1.3: "+getDescription(j));1178 myprintln("~ CRS:84 without WMS 1.3: "+getDescription(j)); 1178 1179 } 1179 1180 } else if (oldproj.containsKey(p)) { … … 1184 1185 } 1185 1186 if (!unsupported.isEmpty()) { 1186 myprintln(" *Projections "+String.join(", ", unsupported)+" not supported by JOSM: "+getDescription(j));1187 myprintln("~ Projections "+String.join(", ", unsupported)+" not supported by JOSM: "+getDescription(j)); 1187 1188 } 1188 1189 for (String o : old) { 1189 myprintln(" *Projection "+o+" is an old unsupported code and has been replaced by "+oldproj.get(o)+": "1190 myprintln("~ Projection "+o+" is an old unsupported code and has been replaced by "+oldproj.get(o)+": " 1190 1191 + getDescription(j)); 1191 1192 } 1192 1193 } 1193 1194 if (urlLc.contains("version=1.3") && !urlLc.contains("crs={proj}")) { 1194 myprintln(" *WMS 1.3 with strange CRS specification: "+getDescription(j));1195 myprintln("~ WMS 1.3 with strange CRS specification: "+getDescription(j)); 1195 1196 } else if (urlLc.contains("version=1.1") && !urlLc.contains("srs={proj}")) { 1196 myprintln(" *WMS 1.1 with strange SRS specification: "+getDescription(j));1197 myprintln("~ WMS 1.1 with strange SRS specification: "+getDescription(j)); 1197 1198 } 1198 1199 } … … 1218 1219 new ImageProvider(jt).get(); 1219 1220 } catch (RuntimeException e) { 1220 myprintln(" *Strange Icon: "+getDescription(j));1221 myprintln("~ Strange Icon: "+getDescription(j)); 1221 1222 } 1222 1223 } … … 1225 1226 for (String u : urls) { 1226 1227 if (!patternU.matcher(u).matches() || u.matches(".*[ \t]+$")) { 1227 myprintln(" *Strange URL '"+u+"': "+getDescription(j));1228 myprintln("~ Strange URL '"+u+"': "+getDescription(j)); 1228 1229 } else { 1229 1230 try { … … 1232 1233 int port = jurl.getPort(); 1233 1234 if (!(domain.matches("^\\d+\\.\\d+\\.\\d+\\.\\d+$")) && !dv.isValid(domain)) 1234 myprintln(" *Strange Domain '"+domain+"': "+getDescription(j));1235 myprintln("~ Strange Domain '"+domain+"': "+getDescription(j)); 1235 1236 else if (80 == port || 443 == port) { 1236 myprintln(" *Useless port '"+port+"': "+getDescription(j));1237 myprintln("~ Useless port '"+port+"': "+getDescription(j)); 1237 1238 } 1238 1239 } catch (MalformedURLException e) { 1239 myprintln(" *Malformed URL '"+u+"': "+getDescription(j)+" => "+e.getMessage());1240 myprintln("~ Malformed URL '"+u+"': "+getDescription(j)+" => "+e.getMessage()); 1240 1241 } 1241 1242 } … … 1246 1247 } 1247 1248 if (isBlank(id)) { 1248 myprintln(" *No JOSM-ID: "+getDescription(j));1249 myprintln("~ No JOSM-ID: "+getDescription(j)); 1249 1250 } else if (josmIds.containsKey(id)) { 1250 myprintln(" *JOSM-ID "+id+" not unique: "+getDescription(j));1251 myprintln("~ JOSM-ID "+id+" not unique: "+getDescription(j)); 1251 1252 } else { 1252 1253 josmIds.put(id, j); … … 1257 1258 Matcher m = patternD.matcher(d); 1258 1259 if (!m.matches()) { 1259 myprintln(" *JOSM-Date '"+d+"' is strange: "+getDescription(j));1260 myprintln("~ JOSM-Date '"+d+"' is strange: "+getDescription(j)); 1260 1261 } else { 1261 1262 try { … … 1263 1264 Date second = verifyDate(m.group(9), m.group(11), m.group(13)); 1264 1265 if (second.compareTo(first) < 0) { 1265 myprintln(" *JOSM-Date '"+d+"' is strange (second earlier than first): "+getDescription(j));1266 myprintln("~ JOSM-Date '"+d+"' is strange (second earlier than first): "+getDescription(j)); 1266 1267 } 1267 1268 } catch (Exception e) { 1268 myprintln(" *JOSM-Date '"+d+"' is strange ("+e.getMessage()+"): "+getDescription(j));1269 myprintln("~ JOSM-Date '"+d+"' is strange ("+e.getMessage()+"): "+getDescription(j)); 1269 1270 } 1270 1271 } 1271 1272 } 1272 1273 if (isNotBlank(getAttributionUrl(j)) && isBlank(getAttributionText(j))) { 1273 myprintln(" *Attribution link without text: "+getDescription(j));1274 myprintln("~ Attribution link without text: "+getDescription(j)); 1274 1275 } 1275 1276 if (isNotBlank(getLogoUrl(j)) && isBlank(getLogoImage(j))) { 1276 myprintln(" *Logo link without image: "+getDescription(j));1277 myprintln("~ Logo link without image: "+getDescription(j)); 1277 1278 } 1278 1279 if (isNotBlank(getTermsOfUseText(j)) && isBlank(getTermsOfUseUrl(j))) { 1279 myprintln(" *Terms of Use text without link: "+getDescription(j));1280 myprintln("~ Terms of Use text without link: "+getDescription(j)); 1280 1281 } 1281 1282 List<Shape> js = getShapes(j); … … 1300 1301 || differentCoordinate(b.getMaxLat(), maxlat) 1301 1302 || differentCoordinate(b.getMaxLon(), maxlon)) { 1302 myprintln(" *Bounds do not match shape (is "+b.getMinLat()+","+b.getMinLon()+","+b.getMaxLat()+","+b.getMaxLon()1303 myprintln("~ Bounds do not match shape (is "+b.getMinLat()+","+b.getMinLon()+","+b.getMaxLat()+","+b.getMaxLon() 1303 1304 + ", calculated <bounds min-lat='"+minlat+"' min-lon='"+minlon+"' max-lat='"+maxlat+"' max-lon='"+maxlon+"'>): " 1304 1305 + getDescription(j)); … … 1309 1310 String cat = getCategory(j); 1310 1311 if (isBlank(cat)) { 1311 myprintln(" *No category: "+getDescription(j));1312 myprintln("~ No category: "+getDescription(j)); 1312 1313 } else if (!knownCategories.contains(cat)) { 1313 myprintln(" *Strange category "+cat+": "+getDescription(j));1314 myprintln("~ Strange category "+cat+": "+getDescription(j)); 1314 1315 } 1315 1316 }
Note:
See TracChangeset
for help on using the changeset viewer.