Package org.opengis.referencing.operation

Examples of org.opengis.referencing.operation.MathTransform2D


        // We need to invert the requested gridToWorld and then adjust the requested raster area are accordingly
        //

        // invert the requested grid to world keeping into account the fact that it is related to cell center
        // while the raster is related to cell corner
        MathTransform2D requestedWorldToGrid;
        try {
            requestedWorldToGrid = (MathTransform2D) PixelTranslation.translate(
                    ProjectiveTransform.create(requestedGridToWorld), PixelInCell.CELL_CENTER,
                    PixelInCell.CELL_CORNER).inverse();
        } catch (NoninvertibleTransformException e) {
View Full Code Here


            method.setAccessible(true);
            method.invoke(response);

            Field finalGridToWorldCorner = c.getDeclaredField("finalGridToWorldCorner");
            finalGridToWorldCorner.setAccessible(true);
            MathTransform2D transform = (MathTransform2D) finalGridToWorldCorner.get(response);
            AffineTransform2D affineTransform = (AffineTransform2D) transform;
            assertEquals(18, XAffineTransform.getScaleX0(affineTransform), DELTA);
            assertEquals(18, XAffineTransform.getScaleY0(affineTransform), DELTA);
        } finally {
            if (reader != null) {
View Full Code Here

        //

        // invert the requested grid to world keeping into account the fact that
        // it is related to cell center
        // while the raster is related to cell corner
        MathTransform2D requestedWorldToGrid;
        try {
            requestedWorldToGrid = (MathTransform2D) PixelTranslation.translate(
                            ProjectiveTransform.create(requestedGridToWorld),
                            PixelInCell.CELL_CENTER, PixelInCell.CELL_CORNER)
                    .inverse();
View Full Code Here

            // now create the crop grid to world which can be used to decide
            // which source area we need to crop in the selected level taking
            // into account the scale factors imposed by the selection of this
            // level together with the base level grid to world transformation
            final MathTransform2D cropGridToWorldCorner = (MathTransform2D) ProjectiveTransform
                    .create(selectedlevel.gridToWorldTransform);
            final MathTransform2D cropWorldToGrid = cropGridToWorldCorner.inverse();

            // computing the crop source area which leaves straight into the
            // selected level raster space, NOTICE that at the end we need to
            // take into account the fact that we might also decimate therefore
            // we cannot just use the crop grid to world but we need to correct
View Full Code Here

        // cache "default" transform
        CoordinateReferenceSystem source = delegate.getSchema().getCoordinateReferenceSystem();

        if (source != null) {
            MathTransform2D tx = (MathTransform2D) ReferencingFactoryFinder
                    .getCoordinateOperationFactory(hints).createOperation(source, target)
                    .getMathTransform();

            GeometryCoordinateSequenceTransformer transformer = new GeometryCoordinateSequenceTransformer();
            transformer.setMathTransform(tx);
View Full Code Here

                                .get(crs);

                        if (transformer == null) {
                            transformer = new GeometryCoordinateSequenceTransformer();

                            MathTransform2D tx;

                            try {
                                tx = (MathTransform2D) ReferencingFactoryFinder
                                        .getCoordinateOperationFactory(hints).createOperation(crs,
                                                target).getMathTransform();
View Full Code Here

                  north),
              CRS.decode("EPSG:4326")),
          new Rectangle(
              width,
              height));
      final MathTransform2D fullTransform = (MathTransform2D) ProjectiveTransform.create(worldToScreen);
      // calculate spans
      try {
        final double[] spans = Decimator.computeGeneralizationDistances(
            fullTransform.inverse(),
            new Rectangle(
                width,
                height),
            pixelSize);
        final double cardinalityX = Math.log((spans[0] / 360)) / Math.log(2);
View Full Code Here

            end("gml:limits");

            // Axis Label
            element("gml:axisLabels", "i j");

            final MathTransform2D transform = gg2D.getGridToCRS2D(PixelOrientation.CENTER);
            if (!(transform instanceof AffineTransform2D)) {
                throw new IllegalStateException("Invalid grid to worl provided:"
                        + transform.toString());
            }
            final AffineTransform2D g2W = (AffineTransform2D) transform;

            // Origin
            // we use ULC as per our G2W transformation
View Full Code Here

        // cache "default" transform
        CoordinateReferenceSystem source = delegate.getSchema().getCoordinateReferenceSystem();

        if (source != null) {
            MathTransform2D tx = (MathTransform2D) ReferencingFactoryFinder
                    .getCoordinateOperationFactory(hints).createOperation(source, target)
                    .getMathTransform();

            GeometryCoordinateSequenceTransformer transformer = new GeometryCoordinateSequenceTransformer();
            transformer.setMathTransform(tx);
View Full Code Here

                                .get(crs);

                        if (transformer == null) {
                            transformer = new GeometryCoordinateSequenceTransformer();

                            MathTransform2D tx;

                            try {
                                tx = (MathTransform2D) ReferencingFactoryFinder
                                        .getCoordinateOperationFactory(hints).createOperation(crs,
                                                target).getMathTransform();
View Full Code Here

TOP

Related Classes of org.opengis.referencing.operation.MathTransform2D

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.