Examples of DirectPosition2D


Examples of org.geotools.geometry.DirectPosition2D

        CoordinateReferenceSystem crs1 = factory.createCoordinateReferenceSystem("4326");
        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);
    }
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D

        //
        // Set the ending position to be the same as the starting position,
        // except move "up" 1 unit along the "up" axis.
        //

        DirectPosition2D endingPosition = new DirectPosition2D((DirectPosition) position);
        endingPosition.setOrdinate(upAxisDimension, position.getOrdinate(upAxisDimension) + 1);
        geoCalc.setDestinationPosition(endingPosition);

        //
        // Now just ask for the azimuth, which is our convergence angle
        // estimate.
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D

            // appo
            temp= new double[fc.numBands];
           
            // grid convergence angle manager
            if(fc.gridConvergenceAngleCorrectionNeeded){
                sourceCRSPosition = new DirectPosition2D();
                targetCRSPosition = new DirectPosition2D(fc.targetCRS);               
            }
        }
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D

                    .createValue();
            final GeneralEnvelope originalEnvelope = reader.getOriginalEnvelope(coverageName);
            final GeneralEnvelope newEnvelope = new GeneralEnvelope(originalEnvelope);
            newEnvelope.setCoordinateReferenceSystem(reader
                    .getCoordinateReferenceSystem(coverageName));
            newEnvelope.add(new DirectPosition2D(newEnvelope.getMinimum(0) - 10, newEnvelope
                    .getMinimum(1) - 10));

            // Selecting the same gridRange
            GridEnvelope gridRange = reader.getOriginalGridRange(coverageName);
            gg.setValue(new GridGeometry2D(gridRange, newEnvelope));
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D

        CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:21781", false);// CH1903_LV03

        MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, true);
        // test coordinate: Berne, old reference point
        // see http://www.swisstopo.admin.ch/internet/swisstopo/en/home/topics/survey/sys/refsys/switzerland.html
        DirectPosition2D source = new DirectPosition2D(sourceCRS, 46.9510827861504654, 7.4386324175389165);
        DirectPosition2D result = new DirectPosition2D();

        transform.transform(source, result);
        assertEquals(600000.0, result.x, 0.1);
        assertEquals(200000.0, result.y, 0.1);
    }
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D

    protected DirectPosition[] readCoord2DFloat(int instancesCount)
        throws IOException {
        DirectPosition[] result = new DirectPosition[instancesCount];

        for (int inx = 0; inx < instancesCount; inx++) {
            result[inx] = new DirectPosition2D(readFloat(), readFloat());
        }

        return result;
    }
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D

        throws IOException {
        DirectPosition[] result = null;
        result = new DirectPosition[instancesCount];

        for (int inx = 0; inx < instancesCount; inx++) {
            result[inx] = new DirectPosition2D(readDouble(), readDouble());
        }

        return result;
    }
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D

    public static void assertTransformEquals2_2(final MathTransform transform,
                                                final double  x, final double  y,
                                                final double ex, final double ey)
            throws TransformException
    {
        final DirectPosition2D source = new DirectPosition2D(x,y);
        final DirectPosition2D target = new DirectPosition2D();
        assertSame(target, transform.transform(source, target));
        final String message = "Expected ("+ex+", "+ey+"), "+
                               "transformed=("+target.x+", "+target.y+")";
        assertEquals(message, ex, target.x, EPS);
        assertEquals(message, ey, target.y, EPS);
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D

            "UNIT[\"degree\", 0.017453292519943295], "+
            "AXIS[\"Longitude\", EAST], "+
            "AXIS[\"Latitude\", NORTH]]");      
        // bounds from geotiff
        GeneralEnvelope geotiff = new GeneralEnvelope(source);
        geotiff.add(new DirectPosition2D(source,-179.9,-90.0));
        geotiff.add(new DirectPosition2D(source,180.0,89.9));
       
        Envelope transformed = CRS.transform(geotiff, target );
        assertNotNull( transformed );
        assertTrue( "clipped y",transformed.getUpperCorner().getOrdinate(1) > 88.0);
        assertTrue( "clipped y",transformed.getLowerCorner().getOrdinate(1) < -88.0);
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D

        params.parameter("false_northing")     .setValue0.0  );
        transform = mtFactory.createParameterizedTransform(params);
        if (VERBOSE) {
            System.out.println(transform);
        }
        doTransform(new DirectPosition2D(-2.5, 51.37),
                    new DirectPosition2D(-278298.73, 5718482.24), transform);
    }
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.