Package org.opengis.referencing.operation

Examples of org.opengis.referencing.operation.MathTransform.transform()


               
        CoordinateOperation op = ReferencingFactoryFinder.getCoordinateOperationFactory(null).createOperation( WGS84, WGS84 );
        MathTransform math = op.getMathTransform();
               
        DirectPosition pt1 = new GeneralDirectPosition(0.0,0.0);       
        DirectPosition pt2 = math.transform( pt1, null );
        assertNotNull( pt2 );
         
        double pts[] = new double[] {
                1187128,395268, 1187128,396027,
                1188245,396027, 1188245,395268,
View Full Code Here


        double pts[] = new double[] {
                1187128,395268, 1187128,396027,
                1188245,396027, 1188245,395268,
                1187128,395268};
        double tst[] = new double[ pts.length ];                       
        math.transform( pts, 0, new double[ pts.length ], 0, pts.length/2 );
        for( int i=0; i<pts.length;i++)
            assertTrue( "pts["+i+"]", pts[i] != tst[i] );
    }
    /**
     * Taken from empty udig map calculation of scale.
View Full Code Here

        CoordinateReferenceSystem target = CRS.decode(TARGET_CRS);
        MathTransform mt = CRS.findMathTransform(source, target, true);
       
        // Test MathTransform
        double[] p = new double[2];
        mt.transform(SRC_TEST_POINT, 0, p, 0, 1);
        assertEquals(p[0], DST_TEST_POINT[0], 1e-8);
        assertEquals(p[1], DST_TEST_POINT[1], 1e-8);
    }
   
    /**
 
View Full Code Here

        CoordinateReferenceSystem target = CRS.decode("EPSG:4326");
        MathTransform mt = CRS.findMathTransform(source, target, true);
       
        // Test MathTransform
        double[] p = new double[2];
        mt.transform(SRC_TEST_POINT, 0, p, 0, 1);
        assertEquals(p[0], DST_TEST_POINT[0], 1e-8);
        assertEquals(p[1], DST_TEST_POINT[1], 1e-8);
    }
   
    /**
 
View Full Code Here

        CoordinateReferenceSystem crs2 = factory.createCoordinateReferenceSystem("3005");

        // reproject
        MathTransform transform = CRS.findMathTransform(crs1, crs2,true);
        DirectPosition pos = new DirectPosition2D(48.417, 123.35);
        transform.transform(pos, null);
    }

    public void testAuthorityCodes() throws Exception {
        Set authorityCodes = factory.getAuthorityCodes(CoordinateReferenceSystem.class);
        assertNotNull(authorityCodes);
View Full Code Here

        CoordinateReferenceSystem crs2 = factory.createCoordinateReferenceSystem("3005");

        // reproject
        MathTransform transform = CRS.findMathTransform(crs1, crs2,true);
        DirectPosition pos = new DirectPosition2D(48.417, 123.35);
        transform.transform(pos, null);
    }

    public void testAuthorityCodes() throws Exception {
        Set authorityCodes = factory.getAuthorityCodes(CoordinateReferenceSystem.class);
        assertNotNull(authorityCodes);
View Full Code Here

        CoordinateReferenceSystem crs2 = factory.createCoordinateReferenceSystem("3005");

        // reproject
        MathTransform transform = CRS.findMathTransform(crs1, crs2,true);
        DirectPosition pos = new DirectPosition2D(48.417, 123.35);
        transform.transform(pos, null);       
    }
    @Test
    public void testAuthorityCodes() throws Exception {
        Set authorityCodes = factory.getAuthorityCodes(CoordinateReferenceSystem.class);
        assertNotNull(authorityCodes);
View Full Code Here

        double[][] points2 = new double[points.length][2];
        double[] tp1 = new double[2];
        double[] tp2= new double[2];
        for (double[] point : points) {
            t1.transform(point, 0, tp1, 0, 1);
            t2.transform(point, 0, tp2, 0, 1);
            assertEquals(tp1[0], tp2[0], EPS);
            assertEquals(tp1[1], tp2[1], EPS);
            // check inverse as well
            t1.inverse().transform(tp1, 0, tp1, 0, 1);
            t2.inverse().transform(tp2, 0, tp2, 0, 1);
View Full Code Here

                    // reproject
                    MathTransform transform = CRS.findMathTransform(crs1, crs2,
                            true);
                    DirectPosition pos = new DirectPosition2D(48.417, 123.35);
                    try {
                         transform.transform(pos, null);
                    } catch (Exception e) {
                        // chomp
                    }
                } catch (Exception e) {
                    exceptions++;
View Full Code Here

        CoordinateReferenceSystem crs2 = factory.createCoordinateReferenceSystem("3005");

        // reproject
        MathTransform transform = CRS.findMathTransform(crs1, crs2,true);
        DirectPosition pos = new DirectPosition2D(48.417, 123.35);
        transform.transform(pos, null);
    }

    public void testAuthorityCodes() throws Exception {
        Set authorityCodes = factory.getAuthorityCodes(CoordinateReferenceSystem.class);
        assertNotNull(authorityCodes);
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.