Changeset 13530 in josm
- Timestamp:
- 2018-03-14T20:18:30+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.groovy
r13529 r13530 36 36 def josmUrls = new HashMap<String, ImageryInfo>() 37 37 def josmMirrors = new HashMap<String, ImageryInfo>() 38 static def oldproj = new HashMap<String, String>() 39 static def ignoreproj = new LinkedList<String>() 38 40 39 41 static String eliInputFile = 'imagery_eli.geojson' … … 53 55 parse_command_line_arguments(args) 54 56 def script = new SyncEditorLayerIndex() 57 script.setupProj() 55 58 script.loadSkip() 56 59 script.start() … … 120 123 } 121 124 125 void setupProj() { 126 oldproj.put("EPSG:3359", "EPSG:3404") 127 oldproj.put("EPSG:3785", "EPSG:3857") 128 oldproj.put("EPSG:31297", "EPGS:31287") 129 oldproj.put("EPSG:54004", "EPSG:3857") 130 oldproj.put("EPSG:102100", "EPSG:3857") 131 oldproj.put("EPSG:102113", "EPSG:3857") 132 oldproj.put("EPSG:900913", "EPGS:3857") 133 ignoreproj.add("EPSG:4267") 134 ignoreproj.add("EPSG:5221") 135 ignoreproj.add("EPSG:5514") 136 ignoreproj.add("EPSG:32019") 137 ignoreproj.add("EPSG:102066") 138 ignoreproj.add("EPSG:102067") 139 ignoreproj.add("EPSG:102685") 140 ignoreproj.add("EPSG:102711") 141 } 142 122 143 void loadSkip() { 123 144 def fr = new InputStreamReader(new FileInputStream(ignoreInputFile), "UTF-8") … … 198 219 } else { 199 220 eliUrls.put(url, e) 221 } 222 def s = e.get("properties").get("available_projections") 223 if (s) { 224 def old = new LinkedList<String>() 225 for (def p : s) { 226 def proj = p.getString() 227 if(oldproj.containsKey(proj) || ("CRS:84".equals(proj) && !(url =~ /(?i)version=1\.3/))) { 228 old.add(proj) 229 } 230 } 231 if (old) { 232 def str = String.join(", ", old) 233 myprintln "+ ELI Projections ${str} not useful: ${getDescription(e)}" 234 } 200 235 } 201 236 } … … 664 699 def josmIds = new HashMap<String, ImageryInfo>() 665 700 def all = Projections.getAllProjectionCodes() 666 def oldproj = new HashMap<String, String>()667 def ignoreproj = new LinkedList<String>()668 oldproj.put("EPSG:3359", "EPSG:3404")669 oldproj.put("EPSG:3785", "EPSG:3857")670 oldproj.put("EPSG:31297", "EPGS:31287")671 oldproj.put("EPSG:54004", "EPSG:3857")672 oldproj.put("EPSG:102100", "EPSG:3857")673 oldproj.put("EPSG:102113", "EPSG:3857")674 oldproj.put("EPSG:900913", "EPGS:3857")675 ignoreproj.add("EPSG:4267")676 ignoreproj.add("EPSG:5221")677 ignoreproj.add("EPSG:5514")678 ignoreproj.add("EPSG:32019")679 ignoreproj.add("EPSG:102066")680 ignoreproj.add("EPSG:102067")681 ignoreproj.add("EPSG:102685")682 ignoreproj.add("EPSG:102711")683 701 for (def url : josmUrls.keySet()) { 684 702 def j = josmUrls.get(url) … … 690 708 def unsupported = new LinkedList<String>() 691 709 def old = new LinkedList<String>() 692 for (def p : getProjections(j)) { 710 for (def p : getProjectionsUnstripped(j)) { 693 711 if("CRS:84".equals(p)) { 694 712 if(!(url =~ /(?i)version=1\.3/)) { … … 824 842 } 825 843 static List<Object> getProjections(Object e) { 844 def r = [] 845 def u = getProjectionsUnstripped(e) 846 if(u) { 847 for (def p : u) { 848 if(!oldproj.containsKey(p) && !("CRS:84".equals(p) && !(getUrlStripped(e) =~ /(?i)version=1\.3/))) { 849 r += p 850 } 851 } 852 } 853 return r 854 } 855 static List<Object> getProjectionsUnstripped(Object e) { 826 856 def r 827 857 if (e instanceof ImageryInfo) { … … 831 861 if (s) { 832 862 r = [] 833 for (def p : s) 863 for (def p : s) { 834 864 r += p.getString() 865 } 835 866 } 836 867 }
Note:
See TracChangeset
for help on using the changeset viewer.