Examples of orthodromicDistance()


Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

             * Not yet implemented (an exception will be thrown later).
             * We should probably revisit the way we compute distances.
             */
            return super.distance(coord1, coord2);
        }
        return new Measure(e.orthodromicDistance(cs.getLongitude(coord1),
                                                 cs.getLatitude (coord1),
                                                 cs.getLongitude(coord2),
                                                 cs.getLatitude (coord2)), e.getAxisUnit());
    }

View Full Code Here

Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

     */
    private boolean checkOrthodromicDistance() {
        if (ellipsoid instanceof DefaultEllipsoid) {
            double check;
            final DefaultEllipsoid ellipsoid = (DefaultEllipsoid) this.ellipsoid;
            check = ellipsoid.orthodromicDistance(toDegrees(long1), toDegrees(lat1),
                                                  toDegrees(long2), toDegrees(lat2));
            check = abs(distance - check);
            return check <= (distance+1) * TOLERANCE_CHECK;
        }
        return true;
View Full Code Here

Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

            final double[]     buffer   = new double[6];
            while (!iterator.isDone()) {
                switch (iterator.currentSegment(buffer)) {
                    case PathIterator.SEG_LINETO: {
                        count++;
                        length += ellipsoid.orthodromicDistance(lastX, lastY, buffer[0], buffer[1]);
                        // Fall through
                    }
                    case PathIterator.SEG_MOVETO: {
                        lastX = buffer[0];
                        lastY = buffer[1];
View Full Code Here

Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

        final DefaultEllipsoid e = DefaultEllipsoid.WGS84;
        final double          hm = 0.5/60; // Half of a minute of angle, in degrees.
        /*
         * Test the ellipsoidal model.
         */
        assertEquals("Nautical mile at equator",    1842.78, e.orthodromicDistance(0, 00-hm, 0, 00+hm), 0.2);
        assertEquals("Nautical mile at North pole", 1861.67, e.orthodromicDistance(0, 90-2*hm, 090), 0.2);
        assertEquals("Nautical mile at South pole", 1861.67, e.orthodromicDistance(0, 2*hm-90, 0, -90), 0.2);
        assertEquals("International nautical mile", 1852.00, e.orthodromicDistance(0, 45-hm, 0, 45+hm), 0.2);
        for (double i=0.01; i<180; i+=1) {
            final double base = 180*random.nextDouble()-90;
 
View Full Code Here

Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

        final double          hm = 0.5/60; // Half of a minute of angle, in degrees.
        /*
         * Test the ellipsoidal model.
         */
        assertEquals("Nautical mile at equator",    1842.78, e.orthodromicDistance(0, 00-hm, 0, 00+hm), 0.2);
        assertEquals("Nautical mile at North pole", 1861.67, e.orthodromicDistance(0, 90-2*hm, 090), 0.2);
        assertEquals("Nautical mile at South pole", 1861.67, e.orthodromicDistance(0, 2*hm-90, 0, -90), 0.2);
        assertEquals("International nautical mile", 1852.00, e.orthodromicDistance(0, 45-hm, 0, 45+hm), 0.2);
        for (double i=0.01; i<180; i+=1) {
            final double base = 180*random.nextDouble()-90;
            assertEquals(i+"° rotation", e.getSemiMajorAxis()*Math.toRadians(i),
 
View Full Code Here

Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

        /*
         * Test the ellipsoidal model.
         */
        assertEquals("Nautical mile at equator",    1842.78, e.orthodromicDistance(0, 00-hm, 0, 00+hm), 0.2);
        assertEquals("Nautical mile at North pole", 1861.67, e.orthodromicDistance(0, 90-2*hm, 090), 0.2);
        assertEquals("Nautical mile at South pole", 1861.67, e.orthodromicDistance(0, 2*hm-90, 0, -90), 0.2);
        assertEquals("International nautical mile", 1852.00, e.orthodromicDistance(0, 45-hm, 0, 45+hm), 0.2);
        for (double i=0.01; i<180; i+=1) {
            final double base = 180*random.nextDouble()-90;
            assertEquals(i+"° rotation", e.getSemiMajorAxis()*Math.toRadians(i),
                                         e.orthodromicDistance(base, 0, base+i, 0), 0.2);
View Full Code Here

Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

         * Test the ellipsoidal model.
         */
        assertEquals("Nautical mile at equator",    1842.78, e.orthodromicDistance(0, 00-hm, 0, 00+hm), 0.2);
        assertEquals("Nautical mile at North pole", 1861.67, e.orthodromicDistance(0, 90-2*hm, 090), 0.2);
        assertEquals("Nautical mile at South pole", 1861.67, e.orthodromicDistance(0, 2*hm-90, 0, -90), 0.2);
        assertEquals("International nautical mile", 1852.00, e.orthodromicDistance(0, 45-hm, 0, 45+hm), 0.2);
        for (double i=0.01; i<180; i+=1) {
            final double base = 180*random.nextDouble()-90;
            assertEquals(i+"° rotation", e.getSemiMajorAxis()*Math.toRadians(i),
                                         e.orthodromicDistance(base, 0, base+i, 0), 0.2);
        }
View Full Code Here

Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

        assertEquals("Nautical mile at South pole", 1861.67, e.orthodromicDistance(0, 2*hm-90, 0, -90), 0.2);
        assertEquals("International nautical mile", 1852.00, e.orthodromicDistance(0, 45-hm, 0, 45+hm), 0.2);
        for (double i=0.01; i<180; i+=1) {
            final double base = 180*random.nextDouble()-90;
            assertEquals(i+"° rotation", e.getSemiMajorAxis()*Math.toRadians(i),
                                         e.orthodromicDistance(base, 0, base+i, 0), 0.2);
        }
        /*
         * Test the spherical model. The factory method should create
         * a specialized class, which is not the usual Ellipsoid class.
         */
 
View Full Code Here

Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

        final DefaultEllipsoid s = DefaultEllipsoid.createEllipsoid("Sphere", radius, radius, e.getAxisUnit());
        assertTrue("Spheroid class", !DefaultEllipsoid.class.equals(s.getClass()));
        for (double i=0; i<=180; i+=1) {
            final double base = 360*random.nextDouble()-180;
            assertEquals(i+"° rotation", s.getSemiMajorAxis()*Math.toRadians(i),
                                         s.orthodromicDistance(base, 0, base+i, 0), 0.001);
        }
        for (double i=-90; i<=+90; i+=1) {
            final double meridian = 360*random.nextDouble()-180;
            assertEquals(i+"° rotation", s.getSemiMajorAxis()*Math.toRadians(Math.abs(i)),
                                         s.orthodromicDistance(meridian, 0, meridian, i), 0.001);
View Full Code Here

Examples of org.geotools.referencing.datum.DefaultEllipsoid.orthodromicDistance()

                                         s.orthodromicDistance(base, 0, base+i, 0), 0.001);
        }
        for (double i=-90; i<=+90; i+=1) {
            final double meridian = 360*random.nextDouble()-180;
            assertEquals(i+"° rotation", s.getSemiMajorAxis()*Math.toRadians(Math.abs(i)),
                                         s.orthodromicDistance(meridian, 0, meridian, i), 0.001);
        }
        for (int i=0; i<100; i++) {
            final double y1 =  -90 + 180*random.nextDouble();
            final double y2 =  -90 + 180*random.nextDouble();
            final double x1 = -180 + 360*random.nextDouble();
 
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.