Changeset 13792 in josm for trunk/scripts
- Timestamp:
- 2018-05-20T17:28:55+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.groovy
r13780 r13792 35 35 class SyncEditorLayerIndex { 36 36 37 List<ImageryInfo> josmEntries ;38 JsonArray eliEntries ;37 List<ImageryInfo> josmEntries 38 JsonArray eliEntries 39 39 40 40 def eliUrls = new HashMap<String, JsonObject>() … … 57 57 */ 58 58 static main(def args) { 59 Locale.setDefault(Locale.ROOT) ;59 Locale.setDefault(Locale.ROOT) 60 60 parse_command_line_arguments(args) 61 61 Main.determinePlatformHook() … … 72 72 def stream = new OutputStreamWriter(file, "UTF-8") 73 73 script.printentries(script.josmEntries, stream) 74 stream.close() ;75 file.close() ;74 stream.close() 75 file.close() 76 76 } 77 77 script.loadELIEntries() … … 80 80 def stream = new OutputStreamWriter(file, "UTF-8") 81 81 script.printentries(script.eliEntries, stream) 82 stream.close() ;83 file.close() ;82 stream.close() 83 file.close() 84 84 } 85 85 script.checkInOneButNotTheOther() … … 87 87 script.end() 88 88 if(outputStream != null) { 89 outputStream.close() ;89 outputStream.close() 90 90 } 91 91 if(outputFile != null) { 92 outputFile.close() ;92 outputFile.close() 93 93 } 94 94 } … … 425 425 eliUrls.remove(e) 426 426 eliUrls.put(urlj,e) 427 break ;427 break 428 428 } 429 429 } … … 901 901 } 902 902 } 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 } 903 907 } 904 908 } … … 1011 1015 if (e instanceof ImageryInfo) { 1012 1016 if("wms".equals(getType(e)) && e.getName() =~ / mirror/) 1013 return null ;1017 return null 1014 1018 int mz = e.getMinZoom() 1015 1019 return mz == 0 ? null : mz … … 1023 1027 if (e instanceof ImageryInfo) { 1024 1028 if("wms".equals(getType(e)) && e.getName() =~ / mirror/) 1025 return null ;1029 return null 1026 1030 int mz = e.getMaxZoom() 1027 1031 return mz == 0 ? null : mz … … 1064 1068 static String getTermsOfUseUrl(Object e) { 1065 1069 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 } 1066 1076 return null 1067 1077 }
Note:
See TracChangeset
for help on using the changeset viewer.