Changeset 13598 in josm for trunk/test


Ignore:
Timestamp:
2018-04-05T19:03:04+02:00 (16 months ago)
Author:
Don-vip
Message:

see #16129 - add new projections and support for new format of ESRI file

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  
    7979    static Random rand = new SecureRandom();
    8080
     81    static boolean debug;
     82
    8183    /**
    8284     * Setup test.
     
    9294     */
    9395    public static void main(String[] args) throws IOException {
     96        debug = args.length > 0 && "debug".equals(args[0]);
    9497        Collection<RefEntry> refs = readData();
    9598        refs = updateData(refs);
     
    236239        pb.environment().put("PROJ_LIB", new File(PROJ_LIB_DIR).getAbsolutePath());
    237240
    238         String output;
     241        String output = "";
    239242        try {
    240243            Process process = pb.start();
    241244            OutputStream stdin = process.getOutputStream();
    242245            InputStream stdout = process.getInputStream();
     246            InputStream stderr = process.getErrorStream();
    243247            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);
    245253            }
    246254            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                }
    248268            }
    249269        } catch (IOException e) {
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java

    r11324 r13598  
    2424    String text;
    2525
     26    /**
     27     * Tests that projections are numerically stable in their definition bounds (round trip error &lt; 1e-5)
     28     */
    2629    @Test
    2730    public void testProjections() {
     
    5558            testProjection(Projections.getProjectionByCode("EPSG:"+Integer.toString(3942+i))); // Lambert CC9 Zones France
    5659        }
     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
    5767
    5868        if (error) {
     
    104114    Collection<String> projIds;
    105115
     116    /**
     117     * Tests that projections are numerically stable in their definition bounds (round trip error &lt; epsilon)
     118     */
    106119    @Test
    107120    public void testProjs() {
     
    127140        testProj("merc", 1e-5, "");
    128141        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, "");
    129145
    130146        if (error2) {
Note: See TracChangeset for help on using the changeset viewer.