Changeset 9127 in josm
- Timestamp:
- 2015-12-15T10:36:12+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/Projections.java
r9126 r9127 142 142 nadgrids.put("ntf_r93_b.gsb", NTV2GridShiftFileWrapper.ntf_rgf93); 143 143 144 List<ProjectionDefinition> pds; 144 145 try { 145 inits = loadProjectionDefinitions("resource://data/projection/epsg");146 pds = loadProjectionDefinitions("resource://data/projection/epsg"); 146 147 } catch (IOException ex) { 147 148 throw new RuntimeException(ex); 149 } 150 inits = new LinkedHashMap<>(); 151 for (ProjectionDefinition pd : pds) { 152 inits.put(pd.code, pd); 148 153 } 149 154 } … … 203 208 * @throws java.io.IOException 204 209 */ 205 public static Map<String,ProjectionDefinition> loadProjectionDefinitions(String path) throws IOException {210 public static List<ProjectionDefinition> loadProjectionDefinitions(String path) throws IOException { 206 211 try ( 207 212 InputStream in = new CachedFile(path).getInputStream(); … … 221 226 * @throws java.io.IOException 222 227 */ 223 public static Map<String,ProjectionDefinition> loadProjectionDefinitions(BufferedReader r) throws IOException {224 Map<String, ProjectionDefinition> result = new LinkedHashMap<>();228 public static List<ProjectionDefinition> loadProjectionDefinitions(BufferedReader r) throws IOException { 229 List<ProjectionDefinition> result = new ArrayList<>(); 225 230 Pattern epsgPattern = Pattern.compile("<(\\d+)>(.*)<>"); 226 231 String line, lastline = ""; … … 234 239 String code = "EPSG:" + m.group(1); 235 240 String definition = m.group(2).trim(); 236 result. put(code,new ProjectionDefinition(code, name, definition));241 result.add(new ProjectionDefinition(code, name, definition)); 237 242 } else { 238 243 Main.warn("Failed to parse line from the EPSG projection definition: "+line);
Note:
See TracChangeset
for help on using the changeset viewer.