Package org.opengis.referencing.operation

Examples of org.opengis.referencing.operation.MathTransform2D


        // 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

        // GridEnvelope levelTileRange;
        GridEnvelope matchingTiles;

        int rasterIndex = query.getRasterIndex();
        int pyramidLevel = query.getPyramidLevel();
        MathTransform2D rasterToModel = (MathTransform2D) rasterInfo.getRasterToModel(rasterIndex,
                pyramidLevel);
        MathTransform2D modelToRaster;

        try {
            modelToRaster = (MathTransform2D) rasterToModel.inverse();
            final GeneralEnvelope adjustedGRange = CRS.transform(modelToRaster, requestedEnvelope);
View Full Code Here

        String handle = "test_handle";
        DateRange range = new DateRange(new Date(10000), new Date(20000));
        DateRangeTreeSet set = new DateRangeTreeSet();
        set.add(range);
        Filter filter = Filter.INCLUDE;
        MathTransform2D gridToWorldTransform = new AffineTransform2D(
                AffineTransform.getTranslateInstance(0, 0));
        Set<NumberRange<Double>> verticalSubset = new HashSet<NumberRange<Double>>();
        verticalSubset.add(new NumberRange<Double>(Double.class, 0.0d, 10000.0d));
        // Setting of the request parameters
        request.setName(coverageName);
View Full Code Here

    public MathTransform getOriginalGridToWorld(String coverageName, PixelInCell pixInCell) {
        coverageName = checkUnspecifiedCoverage(coverageName);
        try {
            final CoverageSource source = getGridCoverageSource(coverageName);
            VariableAdapter.UnidataSpatialDomain spatialDomain = (UnidataSpatialDomain) source.getSpatialDomain();
            MathTransform2D gridToWorld = spatialDomain.getGridToWorldTransform(null);
            if (pixInCell == PixelInCell.CELL_CENTER) {
                return gridToWorld;
            }

            // we do have to change the pixel datum
View Full Code Here

            // 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 = (MathTransform2D) PixelTranslation.translate(
                    ProjectiveTransform.create(requestedGridToWorld), PixelInCell.CELL_CENTER,
                    PixelInCell.CELL_CORNER).inverse();

            if (!needsReprojection) {
View Full Code Here

                        LOGGER.info("Horizontal domain is null");
                    } else {
                        // print the horizontal domain elements
                        final CoordinateReferenceSystem crs2D = spatialDomain.getCoordinateReferenceSystem2D();
                        assert crs2D != null;
                        final MathTransform2D g2w = spatialDomain.getGridToWorldTransform(null);
                        assert g2w != null;
                        final Set<? extends BoundingBox> spatialElements = spatialDomain.getSpatialElements(true, null);
                        assert spatialElements != null && !spatialElements.isEmpty();

                        final StringBuilder buf = new StringBuilder();
View Full Code Here

        checkRequest(request);
        this.spatialRequestHelper = new SpatialRequestHelper();

        BoundingBox requestedBBox = request.getGeographicArea();
        Rectangle requestedRasterArea = request.getRasterArea();
        MathTransform2D requestedG2W = request.getGridToWorldTransform();
        spatialRequestHelper.setRequestedBBox(requestedBBox);
        spatialRequestHelper.setRequestedRasterArea(requestedRasterArea);
        spatialRequestHelper.setRequestedGridToWorld((AffineTransform) requestedG2W);

        // initialize
View Full Code Here

                    renderingEnvelope.getCoordinateReferenceSystem());
            if (targetEnvelope.isEmpty() || targetEnvelope.isNull()) {
                return null;
            }

            MathTransform2D mt = coverages.get(0).getGridGeometry().getCRSToGrid2D();
            Rectangle rasterSpaceEnvelope;
            rasterSpaceEnvelope = CRS.transform(mt, targetEnvelope).toRectangle2D().getBounds();
            GridEnvelope2D gridRange = new GridEnvelope2D(rasterSpaceEnvelope);
            GridGeometry2D gridGeometry = new GridGeometry2D(gridRange, targetEnvelope);
View Full Code Here

            MathTransform toWgs84_2d = CRS.findMathTransform( DefaultGeographicCRS.WGS84_3D, DefaultGeographicCRS.WGS84);
            transform = ConcatenatedTransform.create(toWgs84_3d, toWgs84_2d);
            sourceCRS = DefaultGeographicCRS.WGS84;
        }
        // the basic crs transformation, if any
        MathTransform2D mt;
        if (sourceCRS == null || destCRS == null || CRS.equalsIgnoreMetadata(sourceCRS, destCRS)) {
            mt = null;
        } else {
            mt = (MathTransform2D) CRS.findMathTransform(sourceCRS, destCRS, true);
        }
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.