Changeset 13792 in josm for trunk/scripts


Ignore:
Timestamp:
2018-05-20T17:28:55+02:00 (6 years ago)
Author:
stoecker
Message:

fix #16103 - add map type definitions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.groovy

    r13780 r13792  
    3535class SyncEditorLayerIndex {
    3636
    37     List<ImageryInfo> josmEntries;
    38     JsonArray eliEntries;
     37    List<ImageryInfo> josmEntries
     38    JsonArray eliEntries
    3939
    4040    def eliUrls = new HashMap<String, JsonObject>()
     
    5757     */
    5858    static main(def args) {
    59         Locale.setDefault(Locale.ROOT);
     59        Locale.setDefault(Locale.ROOT)
    6060        parse_command_line_arguments(args)
    6161        Main.determinePlatformHook()
     
    7272            def stream = new OutputStreamWriter(file, "UTF-8")
    7373            script.printentries(script.josmEntries, stream)
    74             stream.close();
    75             file.close();
     74            stream.close()
     75            file.close()
    7676        }
    7777        script.loadELIEntries()
     
    8080            def stream = new OutputStreamWriter(file, "UTF-8")
    8181            script.printentries(script.eliEntries, stream)
    82             stream.close();
    83             file.close();
     82            stream.close()
     83            file.close()
    8484        }
    8585        script.checkInOneButNotTheOther()
     
    8787        script.end()
    8888        if(outputStream != null) {
    89             outputStream.close();
     89            outputStream.close()
    9090        }
    9191        if(outputFile != null) {
    92             outputFile.close();
     92            outputFile.close()
    9393        }
    9494    }
     
    425425                            eliUrls.remove(e)
    426426                            eliUrls.put(urlj,e)
    427                             break;
     427                            break
    428428                        }
    429429                    }
     
    901901                }
    902902            }
     903            def cat = getCategory(j)
     904            if(cat != null && cat != "photo" && cat != "map" && cat != "historicmap" && cat != "osmbasedmap" && cat != "historicphoto" && cat != "other") {
     905                myprintln "* Strange category ${cat}: ${getDescription(j)}"
     906            }
    903907        }
    904908    }
     
    10111015        if (e instanceof ImageryInfo) {
    10121016            if("wms".equals(getType(e)) && e.getName() =~ / mirror/)
    1013                 return null;
     1017                return null
    10141018            int mz = e.getMinZoom()
    10151019            return mz == 0 ? null : mz
     
    10231027        if (e instanceof ImageryInfo) {
    10241028            if("wms".equals(getType(e)) && e.getName() =~ / mirror/)
    1025                 return null;
     1029                return null
    10261030            int mz = e.getMaxZoom()
    10271031            return mz == 0 ? null : mz
     
    10641068    static String getTermsOfUseUrl(Object e) {
    10651069        if (e instanceof ImageryInfo) return e.getTermsOfUseURL()
     1070        return null
     1071    }
     1072    static String getCategory(Object e) {
     1073        if (e instanceof ImageryInfo) {
     1074            return e.getImageryCategoryOriginalString()
     1075        }
    10661076        return null
    10671077    }
Note: See TracChangeset for help on using the changeset viewer.