Changeset 13598 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2018-04-05T19:03:04+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/projection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
r12795 r13598 79 79 static Random rand = new SecureRandom(); 80 80 81 static boolean debug; 82 81 83 /** 82 84 * Setup test. … … 92 94 */ 93 95 public static void main(String[] args) throws IOException { 96 debug = args.length > 0 && "debug".equals(args[0]); 94 97 Collection<RefEntry> refs = readData(); 95 98 refs = updateData(refs); … … 236 239 pb.environment().put("PROJ_LIB", new File(PROJ_LIB_DIR).getAbsolutePath()); 237 240 238 String output ;241 String output = ""; 239 242 try { 240 243 Process process = pb.start(); 241 244 OutputStream stdin = process.getOutputStream(); 242 245 InputStream stdout = process.getInputStream(); 246 InputStream stderr = process.getErrorStream(); 243 247 try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdin, StandardCharsets.UTF_8))) { 244 writer.write(String.format("%.9f %.9f%n", ll.lon(), ll.lat())); 248 String s = String.format("%.9f %.9f%n", ll.lon(), ll.lat()); 249 if (debug) { 250 System.out.println("\n" + String.join(" ", args) + "\n" + s); 251 } 252 writer.write(s); 245 253 } 246 254 try (BufferedReader reader = new BufferedReader(new InputStreamReader(stdout, StandardCharsets.UTF_8))) { 247 output = reader.readLine(); 255 String line; 256 while (null != (line = reader.readLine())) { 257 if (debug) { 258 System.out.println("> " + line); 259 } 260 output = line; 261 } 262 } 263 try (BufferedReader reader = new BufferedReader(new InputStreamReader(stderr, StandardCharsets.UTF_8))) { 264 String line; 265 while (null != (line = reader.readLine())) { 266 System.err.println("! " + line); 267 } 248 268 } 249 269 } catch (IOException e) { -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java
r11324 r13598 24 24 String text; 25 25 26 /** 27 * Tests that projections are numerically stable in their definition bounds (round trip error < 1e-5) 28 */ 26 29 @Test 27 30 public void testProjections() { … … 55 58 testProjection(Projections.getProjectionByCode("EPSG:"+Integer.toString(3942+i))); // Lambert CC9 Zones France 56 59 } 60 61 for (int i = 0; i <= 17; ++i) { 62 testProjection(Projections.getProjectionByCode("EPSG:"+Integer.toString(102421+i))); // WGS_1984_ARC_System Zones 63 } 64 65 testProjection(Projections.getProjectionByCode("EPSG:102016")); // North Pole 66 testProjection(Projections.getProjectionByCode("EPSG:102019")); // South Pole 57 67 58 68 if (error) { … … 104 114 Collection<String> projIds; 105 115 116 /** 117 * Tests that projections are numerically stable in their definition bounds (round trip error < epsilon) 118 */ 106 119 @Test 107 120 public void testProjs() { … … 127 140 testProj("merc", 1e-5, ""); 128 141 testProj("sinu", 1e-4, ""); 142 testProj("aeqd", 1e-5, "+lon_0=0dE +lat_0=90dN"); 143 testProj("aeqd", 1e-5, "+lon_0=0dE +lat_0=90dS"); 144 testProj("eqc", 1e-5, ""); 129 145 130 146 if (error2) {
Note:
See TracChangeset
for help on using the changeset viewer.