Package org.geotools.referencing.operation

Examples of org.geotools.referencing.operation.DefaultMathTransformFactory$MethodFilter


         * Those colliding points are simplified to a single point.  
         * @param geom
         * @return
         */
        Geometry decimate(Geometry geom) {
          DefaultMathTransformFactory f= new DefaultMathTransformFactory();
            MathTransform xform=null;
      try {
        xform = f.createAffineTransform(new GeneralMatrix(worldToScreen.createInverse()));
        Decimator decimator=new Decimator(xform,mapArea);
              geom=decimator.decimate(geom);
      } catch (FactoryException e1) {
       
      } catch (NoninvertibleTransformException e1) {
View Full Code Here


                matrix[3] = tx.get( "shearY") != null ? tx.get( "shearY") : matrix[3];
                matrix[4] = tx.get( "scaleY") != null ? tx.get( "scaleY") : matrix[4];
                matrix[5] = tx.get( "translateY") != null ? tx.get( "translateY") : matrix[5];
                matrix[8] = 1.0;
               
                MathTransform gridToCRS = new DefaultMathTransformFactory()
                    .createAffineTransform( new GeneralMatrix(3,3,matrix));
                coverage.setGrid( new GridGeometry2D(range,gridToCRS,crs) );
            }
            else {
                coverage.setGrid( new GridGeometry2D( range, gridEnvelope ) );
View Full Code Here

  private static CoordinateReferenceSystem getProjectedCRS(
      final GridCoverage2D coverage) {
    try {
      final GeographicCRS base = (GeographicCRS) coverage.getCoordinateReferenceSystem();
      final Ellipsoid ellipsoid = base.getDatum().getEllipsoid();
      final DefaultMathTransformFactory factory = new DefaultMathTransformFactory();
      final ParameterValueGroup parameters = factory.getDefaultParameters("Oblique_Stereographic");
      parameters.parameter("semi_major").setValue(ellipsoid.getSemiMajorAxis());
      parameters.parameter("semi_minor").setValue(ellipsoid.getSemiMinorAxis());
      parameters.parameter("central_meridian").setValue(5);
      parameters.parameter("latitude_of_origin").setValue(-5);
      final MathTransform mt;
      try {
        mt = factory.createParameterizedTransform(parameters);
      } catch (FactoryException exception) {
        fail(exception.getLocalizedMessage());
        return null;
      }
      //create the projected crs
View Full Code Here

     * Tests parsing with custom axis length. At the difference of the previous test,
     * the WKT formatting in this test should include the axis length as parameter values.
     */
    @Test
    public void testCustomAxisLength() throws FactoryException, ParseException {
        DefaultMathTransformFactory factory = new DefaultMathTransformFactory();
        ParameterValueGroup parameters = factory.getDefaultParameters("Lambert_Conformal_Conic_2SP");

        final double majorAxis = 6.3712e+6;
        final double minorAxis = 6.3712e+6;
        parameters.parameter("semi_major").setValue(majorAxis);
        parameters.parameter("semi_minor").setValue(minorAxis);
        parameters.parameter("latitude_of_origin").setValue(25.0);
        parameters.parameter("standard_parallel_1").setValue(25.0);
        parameters.parameter("standard_parallel_2").setValue(25.0);
        parameters.parameter("longitude_of_origin").setValue(-95.0);
        parameters.parameter("false_easting").setValue(0.0);
        parameters.parameter("false_northing").setValue(0.0);

        GeographicCRS base = DefaultGeographicCRS.WGS84;
        MathTransform mt   = factory.createParameterizedTransform(parameters);
        CartesianCS cs = DefaultCartesianCS.PROJECTED;
        CoordinateReferenceSystem crs = new DefaultProjectedCRS("Lambert", base, mt, cs);

        final String wkt = crs.toWKT();
        assertTrue(wkt.contains("semi_major"));
View Full Code Here

    super.setMappedPositions(vectors);
    localpositions = vectors;
    this.envelope = envelope;
    this.gridParameters = params;
    DefaultMathTransformFactory s = new DefaultMathTransformFactory();
    this.worldToGrid = this.getIdntityTransform();
  }
View Full Code Here

               // Generates 15 MappedPositions of approximately 2 m differences
               List<MappedPosition> mp = generateMappedPositions(env, 15, 0.01, crs);

               WarpGridBuilder builder = new IDWGridBuilder(mp, 20, 20, env, ProjectiveTransform.create(M));

               final DefaultMathTransformFactory factory = new DefaultMathTransformFactory();
               ParameterValueGroup gridParams = factory.getDefaultParameters("Warp Grid (from file)");
               String pathx = path+"dx";
               String pathy = path+"dy";
               builder.writeDeltaFile(0, pathx);
               builder.writeDeltaFile(1, pathy);
               gridParams.parameter("X_difference_file").setValue(pathx);
View Full Code Here

     */
    private static CoordinateReferenceSystem getProjectedCRS(final GridCoverage2D coverage) {
        try {
            final GeographicCRS  base = (GeographicCRS) coverage.getCoordinateReferenceSystem();
            final Ellipsoid ellipsoid = base.getDatum().getEllipsoid();
            final DefaultMathTransformFactory factory = new DefaultMathTransformFactory();
            final ParameterValueGroup parameters = factory.getDefaultParameters("Oblique_Stereographic");
            parameters.parameter("semi_major").setValue(ellipsoid.getSemiMajorAxis());
            parameters.parameter("semi_minor").setValue(ellipsoid.getSemiMinorAxis());
            parameters.parameter("central_meridian").setValue(5);
            parameters.parameter("latitude_of_origin").setValue(-5);
            final MathTransform mt;
            try {
                mt = factory.createParameterizedTransform(parameters);
            } catch (FactoryException exception) {
                fail(exception.getLocalizedMessage());
                return null;
            }
            return new DefaultProjectedCRS("Stereographic", base, mt, DefaultCartesianCS.PROJECTED);
View Full Code Here

        CoordinateReferenceSystem target = CRS.decode(s+":"+targetCRS);
       
        // Need to create a derived MathTransform that will handle axis order and units
        // as defined in CRS. Had to cast to DefaultMathTransformFactory because
        // createBaseToDerived is not defined in MathTransformFactory interface (GeoAPI).
        DefaultMathTransformFactory mtf = (DefaultMathTransformFactory)factories.
                getMathTransformFactory();
        MathTransform mt2 = mtf.createBaseToDerived(source, mt, target.getCoordinateSystem());
       
        // Extract name from the transform, if possible, or use class name.
        String methodName;
        try {
            if (mt instanceof AbstractMathTransform) {
View Full Code Here

     * Set up common objects used for all tests.
     */
    @Before
    public void setUp() {
        random  = new Random(-3531834320875149028L);
        factory = new DefaultMathTransformFactory();
    }
View Full Code Here

        params.parameter("8622").setValue(-208.185);
        params.parameter("8611").setValue(1.0000015504);
        params.parameter("8614").setValue(1.56504);
       
        // Transform instance
        MathTransform mt = new DefaultMathTransformFactory().createParameterizedTransform(params);

        // Data from EPSG::9621 example
        final double precision = 1E-3; // dstPoints have 3 decimal units
        final double[] srcPoints = new double[] {300000, 4500000};
        final double[] dstPoints = new double[] {299905.060, 4499796.515};
View Full Code Here

TOP

Related Classes of org.geotools.referencing.operation.DefaultMathTransformFactory$MethodFilter

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.