Package org.geotools.coverage.grid

Examples of org.geotools.coverage.grid.GridEnvelope2D


            miny = Math.min(miny, targetRasterGridRange.getLow(1));
            maxx = Math.max(maxx, targetRasterGridRange.getHigh(0));
            maxy = Math.max(maxy, targetRasterGridRange.getHigh(1));
        }

        final GridEnvelope2D mosaicDimension;
        mosaicDimension = new GridEnvelope2D(minx, miny, 1 + (maxx - minx), 1 + (maxy - miny));
        return mosaicDimension;
    }
View Full Code Here


            ymax = Math.min(ymax, levelRange.getHigh(1) + 1);// 1+ because getHigh is inclusive

            int width = xmax - xmin;
            int height = ymax - ymin;

            resultGridRange = new GridEnvelope2D(xmin, ymin, width, height);
            Rectangle2D finalEnvelope = CRS.transform(rasterToModel, (Rectangle2D) resultGridRange,
                    new Rectangle2D.Double());

            resultEnvelope = new GeneralEnvelope(finalEnvelope);
            CoordinateReferenceSystem crs = rasterInfo.getCoverageCrs();
View Full Code Here

        int tiledImageMinX = (matchingTiles.getLow(0) * tileSize.width);
        int tiledImageMinY = (matchingTiles.getLow(1) * tileSize.height);
        int tiledWidth = (matchingTiles.getSpan(0) * tileSize.width);
        int tiledHeight = (matchingTiles.getSpan(1) * tileSize.height);

        GridEnvelope2D tiledImageGridRange;
        tiledImageGridRange = new GridEnvelope2D(tiledImageMinX, tiledImageMinY, tiledWidth,
                tiledHeight);
        return tiledImageGridRange;
    }
View Full Code Here

        GeneralEnvelope envelope = new GeneralEnvelope(DefaultGeographicCRS.WGS84);
        envelope.setEnvelope(0, 0, 10, 10);
       
        // Setup a rectangle
        Rectangle rect = new Rectangle(0, 0, 20, 20);
        GridEnvelope2D env = new GridEnvelope2D(rect);
       
        // GridGeometry
        GridGeometry2D gg2D = new GridGeometry2D(env, envelope);
       
        // Getting the crop region
View Full Code Here

        GeneralEnvelope envelope = new GeneralEnvelope(DefaultGeographicCRS.WGS84);
        envelope.setEnvelope(0, 0, 10, 10);
       
        // Setup a rectangle
        Rectangle rect = new Rectangle(0, 0, 20, 20);
        GridEnvelope2D env = new GridEnvelope2D(rect);
       
        // GridGeometry
        GridGeometry2D gg2D = new GridGeometry2D(env, envelope);
       
        // Transform
        MathTransform tr = gg2D.getGridToCRS2D(PixelOrientation.UPPER_LEFT);
       
        // Check if with CELL_CENTER, the transformation returned is the same
        assertSame(tr, Utilities.getOriginalGridToWorld(tr, PixelInCell.CELL_CENTER));
       
        // Check with the CELL_CORNER and the following transformation, the result is a
        // Linear Transform
        assertTrue(LinearTransform.class.isAssignableFrom(Utilities.getOriginalGridToWorld(tr,
                PixelInCell.CELL_CORNER).getClass()));
       
        // Check that a Linear Transform is returned also with an Identity transform
        rect = new Rectangle(0, 0, 10, 10);
        env = new GridEnvelope2D(rect);
       
        // GridGeometry
        gg2D = new GridGeometry2D(env, envelope);
       
        // Transform
View Full Code Here

        MathTransform raster2Model = new AffineTransform2D(AffineTransform.getScaleInstance(2, 2));
        CoordinateReferenceSystem spatialReferenceSystem2D = DefaultGeographicCRS.WGS84;
       
        // Calculate a gridGeometry from the image and the MathTransform
        Rectangle bounds = image.getBounds();
        GridGeometry2D gg2D = new GridGeometry2D(new GridEnvelope2D(bounds), raster2Model, spatialReferenceSystem2D);
       
        GeneralEnvelope coverageEnvelope2D = new GeneralEnvelope(gg2D.getEnvelope());
        GridSampleDimension[] sampleDimensions = new GridSampleDimension[]{new GridSampleDimension("testDim")};
        boolean getGeophysics = false;
        // Creation of the Coverage
View Full Code Here

                final Dimension dim = new Dimension();
                GridEnvelope gridRange = reader.getOriginalGridRange(coverageName);
                dim.setSize(gridRange.getSpan(0) * 4.0, gridRange.getSpan(1) * 2.0);
                final Rectangle rasterArea = ((GridEnvelope2D) gridRange);
                rasterArea.setSize(dim);
                final GridEnvelope2D range = new GridEnvelope2D(rasterArea);
                gg.setValue(new GridGeometry2D(range, reducedEnvelope));

                final ParameterValue<List> time = ImageMosaicFormat.TIME.createValue();
                final SimpleDateFormat formatD = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
                formatD.setTimeZone(TimeZone.getTimeZone("GMT"));
View Full Code Here

                final Dimension dim = new Dimension();
                GridEnvelope gridRange = reader.getOriginalGridRange(coverageName);
                dim.setSize(gridRange.getSpan(0) * 4.0, gridRange.getSpan(1) * 2.0);
                final Rectangle rasterArea = ((GridEnvelope2D) gridRange);
                rasterArea.setSize(dim);
                final GridEnvelope2D range = new GridEnvelope2D(rasterArea);
                gg.setValue(new GridGeometry2D(range, reducedEnvelope));

                final ParameterValue<Filter> filterParam = NetCDFFormat.FILTER.createValue();
                FilterFactory2 FF = FeatureUtilities.DEFAULT_FILTER_FACTORY;
                Filter filter = FF.equals(FF.property("z"), FF.literal(450.0));
View Full Code Here

                final Dimension dim = new Dimension();
                GridEnvelope gridRange = reader.getOriginalGridRange(coverageName);
                dim.setSize(gridRange.getSpan(0) * 4.0, gridRange.getSpan(1) * 2.0);
                final Rectangle rasterArea = ((GridEnvelope2D) gridRange);
                rasterArea.setSize(dim);
                final GridEnvelope2D range = new GridEnvelope2D(rasterArea);
                gg.setValue(new GridGeometry2D(range, reducedEnvelope));

                final ParameterValue<List> time = ImageMosaicFormat.TIME.createValue();
                final SimpleDateFormat formatD = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
                formatD.setTimeZone(TimeZone.getTimeZone("GMT"));
View Full Code Here

                final Dimension dim = new Dimension();
                GridEnvelope gridRange = reader.getOriginalGridRange(coverageName);
                dim.setSize(gridRange.getSpan(0) * 4.0, gridRange.getSpan(1) * 2.0);
                final Rectangle rasterArea = ((GridEnvelope2D) gridRange);
                rasterArea.setSize(dim);
                final GridEnvelope2D range = new GridEnvelope2D(rasterArea);
                gg.setValue(new GridGeometry2D(range, reducedEnvelope));

                final ParameterValue<List> time = ImageMosaicFormat.TIME.createValue();
                final SimpleDateFormat formatD = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
                formatD.setTimeZone(TimeZone.getTimeZone("GMT"));
View Full Code Here

TOP

Related Classes of org.geotools.coverage.grid.GridEnvelope2D

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.