Package org.openstreetmap.josm.data.coor

Examples of org.openstreetmap.josm.data.coor.LatLon.lat()


                double[] cart = ellips.latLon2Cart(ll);
                ll = ellips.cart2LatLon(cart);

                if (!(Math.abs(lat - ll.lat())<EPSILON && Math.abs(lon - ll.lon())<EPSILON)) {
                    String error = String.format("point: %s iterations: %s current: %s errorLat: %s errorLon %s",
                            new LatLon(lat, lon), i, ll, Math.abs(lat - ll.lat()), Math.abs(lon - ll.lon()));
                    System.err.println(error);
                    Assert.fail();
                }
            }
View Full Code Here


                    System.err.println(error);
                    Assert.fail();
                }
            }

            maxErrLat = Math.max(maxErrLat, Math.abs(lat - ll.lat()));
            maxErrLon = Math.max(maxErrLon, Math.abs(lon - ll.lon()));
        }
    }
}
View Full Code Here

                }
                LatLon ll = p.eastNorth2latlon(new EastNorth(east, north));
                String errorLL = String.format("%s (%s): Inverse projecting eastnorth(%s,%s):%n" +
                        "        expected: latlon(%s,%s),%n" +
                        "        but got:  latlon(%s,%s)!%n",
                        p.toString(), code, east, north, lat, lon, ll.lat(), ll.lon());
                final double EPSILON_LL = Math.toDegrees(EPSILON_EN / 6378137); // 1 mm accuracy (or better)
                if (Math.abs(lat - ll.lat()) > EPSILON_LL || Math.abs(lon - ll.lon()) > EPSILON_LL) {
                    if (!("yes".equals(System.getProperty("suppressPermanentFailure")) && code.equals("EPSG:21781"))) {
                        fail.append(errorLL);
                    }
View Full Code Here

                String errorLL = String.format("%s (%s): Inverse projecting eastnorth(%s,%s):%n" +
                        "        expected: latlon(%s,%s),%n" +
                        "        but got:  latlon(%s,%s)!%n",
                        p.toString(), code, east, north, lat, lon, ll.lat(), ll.lon());
                final double EPSILON_LL = Math.toDegrees(EPSILON_EN / 6378137); // 1 mm accuracy (or better)
                if (Math.abs(lat - ll.lat()) > EPSILON_LL || Math.abs(lon - ll.lon()) > EPSILON_LL) {
                    if (!("yes".equals(System.getProperty("suppressPermanentFailure")) && code.equals("EPSG:21781"))) {
                        fail.append(errorLL);
                    }
                }
            }
View Full Code Here

            EastNorth en = new EastNorth(533111.69, 152227.85);
            LatLon ll = Main.getProjection().eastNorth2latlon(en);
            if (debug) {
                System.out.println(ll);
            }
            assertTrue("Lausanne", Math.abs(ll.lat() - 46.518) < 0.00001);
            assertTrue("Lausanne", Math.abs(ll.lon() - 6.567) < 0.00001);
        }

        {
            EastNorth en = new EastNorth(685544.16, 292782.91);
View Full Code Here

            EastNorth en = new EastNorth(685544.16, 292782.91);
            LatLon ll = Main.getProjection().eastNorth2latlon(en);
            if (debug) {
                System.out.println(ll);
            }
            assertTrue("Schafouse", Math.abs(ll.lat() - 47.78) < 0.00001);
            assertTrue("Schafouse", Math.abs(ll.lon() - 8.58) < 0.00001);
        }

        {
            EastNorth en = new EastNorth(833068.04, 163265.39);
View Full Code Here

            EastNorth en = new EastNorth(833068.04, 163265.39);
            LatLon ll = Main.getProjection().eastNorth2latlon(en);
            if (debug) {
                System.out.println(ll);
            }
            assertTrue("Grinson", Math.abs(ll.lat() - 46.58) < 0.00001);
            assertTrue("Grinson", Math.abs(ll.lon() - 10.48) < 0.00001);
        }

        {
            EastNorth en = new EastNorth(600000.0, 200000.0);
View Full Code Here

            EastNorth en = new EastNorth(600000.0, 200000.0);
            LatLon ll = Main.getProjection().eastNorth2latlon(en);
            if (debug) {
                System.out.println(ll);
            }
            assertTrue("Berne", Math.abs(ll.lat() - (46.0 + 57.0 / 60 + 3.89813884505 / 3600)) < 0.00001);
            assertTrue("Berne", Math.abs(ll.lon() - (7.0 + 26.0 / 60 + 19.076595154147 / 3600)) < 0.00001);
        }

        {
            EastNorth en = new EastNorth(700000.0, 100000.0);
View Full Code Here

            EastNorth en = new EastNorth(700000.0, 100000.0);
            LatLon ll = Main.getProjection().eastNorth2latlon(en);
            if (debug) {
                System.out.println(ll);
            }
            assertTrue("Ref", Math.abs(ll.lat() - (46.0 + 2.0 / 60 + 38.87 / 3600)) < 0.00001);
            assertTrue("Ref", Math.abs(ll.lon() - (8.0 + 43.0 / 60 + 49.79 / 3600)) < 0.00001);
        }
    }

View Full Code Here

                for (int i=0; i<10; ++i) {
                    EastNorth en = p.latlon2eastNorth(ll);
                    ll = p.eastNorth2latlon(en);
                }
                maxErrLat = Math.max(maxErrLat, Math.abs(lat - ll.lat()));
                maxErrLon = Math.max(maxErrLon, Math.abs(lon - ll.lon()));
            }

            String mark = "";
            if (maxErrLat + maxErrLon > 1e-5) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.