Examples of AffineTransform2D


Examples of org.geotools.referencing.operation.transform.AffineTransform2D

                    request.spatialRequestHelper.getComputedGridToWorld():
                request.spatialRequestHelper.getComputedGridToWorld());
            g2w.concatenate(CoverageUtilities.CENTER_TO_CORNER);
        }
        // move it to the corner
        finalGridToWorldCorner = new AffineTransform2D(g2w);
        finalWorldToGridCorner = finalGridToWorldCorner.inverse();// compute raster bounds

    }
View Full Code Here

Examples of org.geotools.referencing.operation.transform.AffineTransform2D

    public void testDecimateOpenTriangle() throws Exception {
        LineString g = gf.createLineString(csf.create(new double[] {0,0,0,2,2,2,0,0}));
        assertTrue(g.isValid());
       
        Decimator d = new Decimator(3, 3);
        d.decimateTransformGeneralize(g, new AffineTransform2D(new AffineTransform()));
        g.geometryChanged();
        assertTrue(g.isValid());
        assertEquals(4, g.getCoordinateSequence().size());
    }
View Full Code Here

Examples of org.geotools.referencing.operation.transform.AffineTransform2D

   
    @Test
    public void testDistance() throws Exception {
        LineString ls = gf.createLineString(csf.create(new double[] {0,0,1,1,2,2,3,3,4,4,5,5}));
       
        MathTransform identity = new AffineTransform2D(new AffineTransform());
       
        Decimator d = new Decimator(identity, new Rectangle(0,0,5,5), 0.8);
        d.decimateTransformGeneralize((Geometry) ls.clone(), identity);
        assertEquals(6, ls.getNumPoints());
       
View Full Code Here

Examples of org.geotools.referencing.operation.transform.AffineTransform2D

   
    @Test
    public void testDecimate3DPoint() throws Exception {
        Point p = gf.createPoint(csf.create(new double[] {0,1,2}, 3));
       
        MathTransform identity = new AffineTransform2D(new AffineTransform());
       
        Decimator d = new Decimator(identity, new Rectangle(0,0,5,5), 0.8);
        d.decimateTransformGeneralize(p, identity);
        assertEquals(1, p.getNumPoints());
        assertEquals(2, p.getCoordinateSequence().getDimension());
View Full Code Here

Examples of org.geotools.referencing.operation.transform.AffineTransform2D

    @Test
    public void testDecimate3DLine() throws Exception {
      LineString ls = gf.createLineString(csf.create(new double[] {0,0,1, 1,2,1, 3,3,4 ,4,5,5}, 3));
      assertEquals(4, ls.getNumPoints());
       
        MathTransform identity = new AffineTransform2D(new AffineTransform());
       
        Decimator d = new Decimator(identity, new Rectangle(0,0,5,5), 0.8);
        d.decimateTransformGeneralize(ls, identity);
        assertEquals(4, ls.getNumPoints());
        assertEquals(2, ls.getCoordinateSequence().getDimension());
View Full Code Here

Examples of org.geotools.referencing.operation.transform.AffineTransform2D

        writer.write("0");
        close(writer);
        return;
      }
      if ((transform instanceof AffineTransform2D)) {
        final AffineTransform2D affine = (AffineTransform2D) transform;
        writer.write(Double.toString(affine.getScaleX()));
        writer.newLine();
        writer.write(Double.toString(affine.getShearX()));
        writer.newLine();
        writer.write(Double.toString(affine.getShearY()));
        writer.newLine();
        writer.write(Double.toString(affine.getScaleY()));
        writer.newLine();
        writer.write(Double.toString(affine.getTranslateX()));
        writer.newLine();
        writer.write(Double.toString(affine.getTranslateY()));
        close(writer);
        return;
      }
      assert false:transform;
    } catch (IOException e) {
View Full Code Here

Examples of org.geotools.referencing.operation.transform.AffineTransform2D

        }

        // Creation of the list of the transformations to use.
        List<AffineTransform> tr = choice.getTransformationList(gg2D, getIndex(parameters));
        // Selection of the GridToWorld transformation to use for the final coverage
        AffineTransform2D gridToCRS = new AffineTransform2D(choice.getGridToCRS2D(gg2D,
                getIndex(parameters)));
        // Selection of the WorldToGrid transformation to use for the final coverage
        AffineTransform2D crsToGrid = new AffineTransform2D(choice.getCRStoGrid2D(gg2D,
                getIndex(parameters)));
        // Storing the input sources into and array
        GridCoverage2D[] sources = new GridCoverage2D[size];
        sourceCollection.toArray(sources);
        // Creation of the ParameterBlockJAI object to pass to JAI.
View Full Code Here

Examples of org.geotools.referencing.operation.transform.AffineTransform2D

     * @param bounds The image bounds in pixel coordinates.
     * @param gridToCRS The affine transform from pixel coordinates to "real world" coordinates.
     */
    public ImageGeometry(final Rectangle bounds, final AffineTransform gridToCRS) {
        this.gridRange = new GridEnvelope2D(bounds);
        this.gridToCRS = new AffineTransform2D(gridToCRS);
    }
View Full Code Here

Examples of org.geotools.referencing.operation.transform.AffineTransform2D

        double a00 =  x_scale * Math.cos(xy_plane_rotation);
        double a01 = -y_scale * Math.sin(xy_plane_rotation);
        double a10 =  x_scale*  Math.sin(xy_plane_rotation);
        double a11 =  y_scale * Math.cos(xy_plane_rotation);
        AffineTransform at =  new AffineTransform(a00, a10, a01, a11, 0d, 0d);          
        MathTransform theAffineTransform = new AffineTransform2D(at);          
      return theAffineTransform;       
    }
View Full Code Here

Examples of org.geotools.referencing.operation.transform.AffineTransform2D

        // Calculate affine transform coefficients
        double theta = Math.PI * rotation / 648000; // arcsec to rad
        double p1 = scale * Math.cos(theta);
        double p2 = scale * Math.sin(theta);
       
        return new AffineTransform2D(p1, -p2, p2, p1, t1, t2);
    }
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.