Package org.geotools.geometry

Examples of org.geotools.geometry.GeneralDirectPosition


     */
    public void testMathTransform() throws FactoryException, TransformException {
        final MathTransformFactory mtFactory = ReferencingFactoryFinder.getMathTransformFactory(null);
        final ParameterValueGroup p = mtFactory.getDefaultParameters("Earth gravitational model");
        final MathTransform mt = mtFactory.createParameterizedTransform(p);
        DirectPosition pos = new GeneralDirectPosition(new double[] {45, 45, 1000});
        pos = mt.transform(pos, pos);
        assertEquals45.000, pos.getOrdinate(0), 0.001);
        assertEquals45.000, pos.getOrdinate(1), 0.001);
        assertEquals(1001.515, pos.getOrdinate(2), 0.001);
    }
View Full Code Here


    //
    // /////////////////////////////////////////////////////////////////////
    PiecewiseUtilities.ensureNonNull("ptSrc", ptSrc);
    PiecewiseUtilities.checkDimension(ptSrc);
    if (ptDst == null) {
      ptDst = new GeneralDirectPosition(1);
    } else {
      PiecewiseUtilities.checkDimension(ptDst);
    }
    ptDst.setOrdinate(0, transform(ptSrc.getOrdinate(0)));
    return ptDst;
View Full Code Here

  public DirectPosition transform(final DirectPosition ptSrc,
      DirectPosition ptDst) throws TransformException {
    PiecewiseUtilities.checkDimension(ptSrc);
    PiecewiseUtilities.ensureNonNull("DirectPosition", ptSrc);
    if (ptDst == null) {
      ptDst = new GeneralDirectPosition(1);
    } else {
      PiecewiseUtilities.checkDimension(ptDst);
    }
    final double value=ptSrc.getOrdinate(0);
    checkContainment(value);
View Full Code Here

   */
  public DirectPosition transform(final DirectPosition ptSrc,
      DirectPosition ptDst) throws TransformException {
    PiecewiseUtilities.checkDimension(ptSrc);
    if (ptDst == null) {
      ptDst = new GeneralDirectPosition(1);
    } else {
      PiecewiseUtilities.checkDimension(ptDst);
    }
    ptDst.setOrdinate(0, transform(ptSrc.getOrdinate(0)));
    return ptDst;
View Full Code Here

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

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

        return result;
    }
View Full Code Here

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

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

        return result;
    }
View Full Code Here

        param.parameter("dx").setValue( 84.87);
        param.parameter("dy").setValue( 96.49);
        param.parameter("dz").setValue(116.95);

        final MathTransform test = factory.createParameterizedTransform(param);
        final GeneralDirectPosition position = new GeneralDirectPosition(3);
        position.setOrdinate(0, 3771793.97);
        position.setOrdinate(1140253.34);
        position.setOrdinate(2, 5124304.35);
        assertSame(position, test.transform(position, position));
        assertEquals(3771878.84, position.getOrdinate(0), 1E-5);
        assertEquals( 140349.83, position.getOrdinate(1), 1E-5);
        assertEquals(5124421.30, position.getOrdinate(2), 1E-5);
    }
View Full Code Here

        param.parameter("ey") .setValue(0.000);
        param.parameter("ez") .setValue(0.554);
        param.parameter("ppm").setValue(0.219);

        final MathTransform test = factory.createParameterizedTransform(param);
        final GeneralDirectPosition position = new GeneralDirectPosition(3);
        position.setOrdinate(0, 3657660.66);
        position.setOrdinate(1255768.55);
        position.setOrdinate(2, 5201382.11);
        assertSame(position, test.transform(position, position));
        assertEquals(3657660.78, position.getOrdinate(0), 1E-2);
        assertEquals( 255778.43, position.getOrdinate(1), 1E-5);
        assertEquals(5201387.75, position.getOrdinate(2), 1E-2);
    }
View Full Code Here

        param.parameter("ey") .setValue( 0.000);
        param.parameter("ez") .setValue(-0.554);
        param.parameter("ppm").setValue( 0.219);

        final MathTransform test = factory.createParameterizedTransform(param);
        final GeneralDirectPosition position = new GeneralDirectPosition(3);
        position.setOrdinate(0, 3657660.66);
        position.setOrdinate(1255768.55);
        position.setOrdinate(2, 5201382.11);
        assertSame(position, test.transform(position, position));
        assertEquals(3657660.78, position.getOrdinate(0), 1E-2);
        assertEquals( 255778.43, position.getOrdinate(1), 1E-5);
        assertEquals(5201387.75, position.getOrdinate(2), 1E-2);
    }
View Full Code Here

        param.parameter("src_semi_minor").setValue(sourceEllipsoid.getSemiMinorAxis());
        param.parameter("tgt_semi_major").setValue(targetEllipsoid.getSemiMajorAxis());
        param.parameter("tgt_semi_minor").setValue(targetEllipsoid.getSemiMinorAxis());

        final MathTransform test = factory.createParameterizedTransform(param);
        final GeneralDirectPosition position = new GeneralDirectPosition(3);
        position.setOrdinate(0,    4.00); // Longitude
        position.setOrdinate(1,   55.00); // Latitude
        position.setOrdinate(2, -191.61); // Height

        assertSame(position, test.transform(position, position));
        assertEquals( 4.00, position.getOrdinate(0), 1E-2);
        assertEquals(55.00, position.getOrdinate(1), 1E-2);
        assertEquals( 3.23, position.getOrdinate(2), 1E-2);
    }
View Full Code Here

TOP

Related Classes of org.geotools.geometry.GeneralDirectPosition

Copyright © 2018 www.massapicom. 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.