Ignore:
Timestamp:
2018-03-14T18:39:12+01:00 (6 years ago)
Author:
stoecker
Message:

add some more WMS check, different color for now to no get too red

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.groovy

    r13518 r13526  
    2525import org.openstreetmap.josm.data.imagery.ImageryInfo
    2626import org.openstreetmap.josm.data.imagery.Shape
     27import org.openstreetmap.josm.data.projection.Projections;
    2728import org.openstreetmap.josm.io.imagery.ImageryReader
    2829
     
    155156            }
    156157        } else if(options.xhtmlbody || options.xhtml) {
    157             String color = s.startsWith("***") ? "black" : ((s.startsWith("+ ") || s.startsWith("+++ ELI")) ? "blue" :  (s.startsWith("#") ? "indigo" : "red"))
     158            String color = s.startsWith("***") ? "black" : ((s.startsWith("+ ") || s.startsWith("+++ ELI")) ? "blue" :
     159            (s.startsWith("#") ? "indigo" : (s.startsWith("!") ? "orange" : "red")))
    158160            s = "<pre style=\"margin:3px;color:"+color+"\">"+s.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")+"</pre>"
    159161        }
     
    664666            def j = josmUrls.get(url)
    665667            def id = getId(j)
    666             if("wms".equals(getType(j)) && !getProjections(j)) {
    667                 myprintln "* WMS without projections: ${getDescription(j)}"
     668            if("wms".equals(getType(j))) {
     669                if(!getProjections(j)) {
     670                    myprintln "* WMS without projections: ${getDescription(j)}"
     671                } else {
     672                    def all = Projections.getAllProjectionCodes();
     673                    def unsupported = new LinkedList<String>();
     674                    for (def p : getProjections(j)) {
     675                        if("CRS:84".equals(p)) {
     676                            if(!(url =~ /(?i)version=1\.3/)) {
     677                                myprintln "! CRS:84 without WMS 1.3: ${getDescription(j)}"
     678                            }
     679                        } else if(!all.contains(p)) {
     680                            unsupported.add(p)
     681                        }
     682                    }
     683                    if (unsupported) {
     684                        def s = String.join(" ", unsupported)
     685                        myprintln "! Projections ${s} not supported by JOSM (maybe Obsolete code): ${getDescription(j)}"
     686                    }
     687                }
     688                if((url =~ /(?i)version=1\.3/) && !(url =~ /[Cc][Rr][Ss]=\{proj\}/)) {
     689                    myprintln "* WMS 1.3 with strange CRS specification: ${getDescription(j)}"
     690                }
     691                if((url =~ /(?i)version=1\.1/) && !(url =~ /[Ss][Rr][Ss]=\{proj\}/)) {
     692                    myprintln "* WMS 1.1 with strange SRS specification: ${getDescription(j)}"
     693                }
    668694            }
    669695            if(josmMirrors.containsKey(url)) {
Note: See TracChangeset for help on using the changeset viewer.