Changeset 18382 in josm for trunk


Ignore:
Timestamp:
2022-02-18T08:34:05+01:00 (2 years ago)
Author:
stoecker
Message:

separate ELI from validity checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.java

    r18211 r18382  
    308308                        ((s.startsWith("+ ") || s.startsWith("+++ ELI")) ? "blue" :
    309309                            (s.startsWith("#") ? "indigo" :
    310                                 (s.startsWith("!") ? "orange" : "red")));
     310                                (s.startsWith("!") ? "orange" :
     311                                    (s.startsWith("~") ? "red" : "brown"))));
    311312            s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;")+"</pre>";
    312313        }
     
    503504        for (ImageryInfo e : josmEntries) {
    504505            if (isBlank(getUrl(e))) {
    505                 myprintln("+++ JOSM-Entry without URL: " + getDescription(e));
     506                myprintln("~~~ JOSM-Entry without URL: " + getDescription(e));
    506507                continue;
    507508            }
    508509            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));
    510511                continue;
    511512            }
    512513            if (isBlank(getName(e))) {
    513                 myprintln("+++ JOSM-Entry without Name: " + getDescription(e));
     514                myprintln("~~~ JOSM-Entry without Name: " + getDescription(e));
    514515                continue;
    515516            }
    516517            String url = getUrlStripped(e);
    517518            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));
    519520                url = url.replace("{z}", "{zoom}");
    520521            }
    521522            if (josmUrls.containsKey(url)) {
    522                 myprintln("+++ JOSM-URL is not unique: "+url);
     523                myprintln("~~~ JOSM-URL is not unique: "+url);
    523524            } else {
    524525                josmUrls.put(url, e);
     
    530531                origNameField.set(m, m.getOriginalName().replaceAll(" mirror server( \\d+)?", ""));
    531532                if (josmUrls.containsKey(url)) {
    532                     myprintln("+++ JOSM-Mirror-URL is not unique: "+url);
     533                    myprintln("~~~ JOSM-Mirror-URL is not unique: "+url);
    533534                } else {
    534535                    josmUrls.put(url, m);
     
    978979                List<Coordinate> p = shape.getPoints();
    979980                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));
    981982                }
    982983                for (int nump = 1; nump < p.size(); ++nump) {
    983984                    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));
    985986                    }
    986987                }
     
    11681169                String urlLc = url.toLowerCase(Locale.ENGLISH);
    11691170                if (getProjections(j).isEmpty()) {
    1170                     myprintln("* WMS without projections: "+getDescription(j));
     1171                    myprintln("~ WMS without projections: "+getDescription(j));
    11711172                } else {
    11721173                    List<String> unsupported = new LinkedList<>();
     
    11751176                        if ("CRS:84".equals(p)) {
    11761177                            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));
    11781179                            }
    11791180                        } else if (oldproj.containsKey(p)) {
     
    11841185                    }
    11851186                    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));
    11871188                    }
    11881189                    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)+": "
    11901191                                + getDescription(j));
    11911192                    }
    11921193                }
    11931194                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));
    11951196                } 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));
    11971198                }
    11981199            }
     
    12181219                        new ImageProvider(jt).get();
    12191220                    } catch (RuntimeException e) {
    1220                         myprintln("* Strange Icon: "+getDescription(j));
     1221                        myprintln("~ Strange Icon: "+getDescription(j));
    12211222                    }
    12221223                }
     
    12251226            for (String u : urls) {
    12261227                if (!patternU.matcher(u).matches() || u.matches(".*[ \t]+$")) {
    1227                     myprintln("* Strange URL '"+u+"': "+getDescription(j));
     1228                    myprintln("~ Strange URL '"+u+"': "+getDescription(j));
    12281229                } else {
    12291230                    try {
     
    12321233                        int port = jurl.getPort();
    12331234                        if (!(domain.matches("^\\d+\\.\\d+\\.\\d+\\.\\d+$")) && !dv.isValid(domain))
    1234                             myprintln("* Strange Domain '"+domain+"': "+getDescription(j));
     1235                            myprintln("~ Strange Domain '"+domain+"': "+getDescription(j));
    12351236                        else if (80 == port || 443 == port) {
    1236                             myprintln("* Useless port '"+port+"': "+getDescription(j));
     1237                            myprintln("~ Useless port '"+port+"': "+getDescription(j));
    12371238                        }
    12381239                    } catch (MalformedURLException e) {
    1239                         myprintln("* Malformed URL '"+u+"': "+getDescription(j)+" => "+e.getMessage());
     1240                        myprintln("~ Malformed URL '"+u+"': "+getDescription(j)+" => "+e.getMessage());
    12401241                    }
    12411242                }
     
    12461247            }
    12471248            if (isBlank(id)) {
    1248                 myprintln("* No JOSM-ID: "+getDescription(j));
     1249                myprintln("~ No JOSM-ID: "+getDescription(j));
    12491250            } else if (josmIds.containsKey(id)) {
    1250                 myprintln("* JOSM-ID "+id+" not unique: "+getDescription(j));
     1251                myprintln("~ JOSM-ID "+id+" not unique: "+getDescription(j));
    12511252            } else {
    12521253                josmIds.put(id, j);
     
    12571258                Matcher m = patternD.matcher(d);
    12581259                if (!m.matches()) {
    1259                     myprintln("* JOSM-Date '"+d+"' is strange: "+getDescription(j));
     1260                    myprintln("~ JOSM-Date '"+d+"' is strange: "+getDescription(j));
    12601261                } else {
    12611262                    try {
     
    12631264                        Date second = verifyDate(m.group(9), m.group(11), m.group(13));
    12641265                        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));
    12661267                        }
    12671268                    } 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));
    12691270                    }
    12701271                }
    12711272            }
    12721273            if (isNotBlank(getAttributionUrl(j)) && isBlank(getAttributionText(j))) {
    1273                 myprintln("* Attribution link without text: "+getDescription(j));
     1274                myprintln("~ Attribution link without text: "+getDescription(j));
    12741275            }
    12751276            if (isNotBlank(getLogoUrl(j)) && isBlank(getLogoImage(j))) {
    1276                 myprintln("* Logo link without image: "+getDescription(j));
     1277                myprintln("~ Logo link without image: "+getDescription(j));
    12771278            }
    12781279            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));
    12801281            }
    12811282            List<Shape> js = getShapes(j);
     
    13001301                        || differentCoordinate(b.getMaxLat(), maxlat)
    13011302                        || 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()
    13031304                        + ", calculated <bounds min-lat='"+minlat+"' min-lon='"+minlon+"' max-lat='"+maxlat+"' max-lon='"+maxlon+"'>): "
    13041305                        + getDescription(j));
     
    13091310            String cat = getCategory(j);
    13101311            if (isBlank(cat)) {
    1311                 myprintln("* No category: "+getDescription(j));
     1312                myprintln("~ No category: "+getDescription(j));
    13121313            } else if (!knownCategories.contains(cat)) {
    1313                 myprintln("* Strange category "+cat+": "+getDescription(j));
     1314                myprintln("~ Strange category "+cat+": "+getDescription(j));
    13141315            }
    13151316        }
Note: See TracChangeset for help on using the changeset viewer.