Changeset 13602 in josm for trunk/scripts
- Timestamp:
- 2018-04-07T20:42:34+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/BuildProjectionDefinitions.java
r13599 r13602 13 13 import java.util.Map; 14 14 import java.util.TreeMap; 15 import java.util.regex.Matcher; 16 import java.util.regex.Pattern; 15 17 16 18 import org.openstreetmap.josm.data.projection.CustomProjection; … … 81 83 if (list.isEmpty()) 82 84 throw new AssertionError("EPSG file seems corrupted"); 85 Pattern badDmsPattern = Pattern.compile("(\\d+(?:\\.\\d+)?d\\d+(?:\\.\\d+)?')(N|S|E|W)"); 83 86 for (ProjectionDefinition pd : list) { 84 map.put(pd.code, pd); 87 // DMS notation without second causes problems with cs2cs, add 0" 88 Matcher matcher = badDmsPattern.matcher(pd.definition); 89 StringBuffer sb = new StringBuffer(); 90 while (matcher.find()) { 91 matcher.appendReplacement(sb, matcher.group(1) + "0\"" + matcher.group(2)); 92 } 93 matcher.appendTail(sb); 94 map.put(pd.code, new ProjectionDefinition(pd.code, pd.name, sb.toString())); 85 95 } 86 96 } … … 113 123 } 114 124 } 115 out.write("## ESRI-specific projections (source: proj.4):\n");125 out.write("## ESRI-specific projections (source: ESRI):\n"); 116 126 for (ProjectionDefinition pd : esriProj4.values()) { 117 127 pd = new ProjectionDefinition(pd.code, "ESRI: " + pd.name, pd.definition); … … 194 204 result = false; 195 205 noDeprecated++; 206 } 207 208 // exclude projections failing 209 if (Arrays.asList("EPSG:53025", "EPSG:54025", "EPSG:65062", 210 "EPSG:102061", "EPSG:102062", "EPSG:102121", "EPSG:102212", "EPSG:102366", "EPSG:102445", 211 "EPSG:102491", "EPSG:102591", "EPSG:102631", "EPSG:103232", "EPSG:103235", "EPSG:103238", 212 "EPSG:103241", "EPSG:103371", "EPSG:103471", "EPSG:103474", "EPSG:103475" 213 ).contains(pd.code)) { 214 // 53025/54025: Unsuitable parameters 'lat_1' and 'lat_2' for two point method 215 // Others: cs2cs errors to investigate 216 result = false; 196 217 } 197 218
Note:
See TracChangeset
for help on using the changeset viewer.