Package org.geotools.coverage.grid

Examples of org.geotools.coverage.grid.GridCoverage2D.evaluate()


        Assert.assertEquals(nodata, result, TOLERANCE);

        // Check that on the Upper Left border pixel there is valid data
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), actual.getMinX()
                + finalRes, actual.getMinY() + finalRes);
        result = ((int[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);

        // Coverage and RenderedImage disposal
        mosaic.dispose(true);
        resampled.dispose(true);
View Full Code Here


        // Check that on the center of the image there is valid data
        DirectPosition point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(),
                expected.getCenterX(), expected.getCenterY());
        double nodata = 0;
        double result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);

        // Check that on the Upper Left border pixel there is valid data
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), expected.getMinX()
                + finalRes, expected.getMinY() + finalRes);
View Full Code Here

        Assert.assertNotEquals(nodata, result, TOLERANCE);

        // Check that on the Upper Left border pixel there is valid data
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), expected.getMinX()
                + finalRes, expected.getMinY() + finalRes);
        result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);

        // Check that on the Upper Right border pixel there is valid data
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), expected.getMaxX()
                - finalRes, expected.getMinY() + finalRes);
View Full Code Here

        Assert.assertNotEquals(nodata, result, TOLERANCE);

        // Check that on the Upper Right border pixel there is valid data
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), expected.getMaxX()
                - finalRes, expected.getMinY() + finalRes);
        result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);

        // Coverage and RenderedImage disposal
        mosaic.dispose(true);
        disposeCoveragePlanarImage(mosaic);
View Full Code Here

        // Ensure that no black lines are present on the border between the input images
        // Check that on the center of the image there is valid data
        DirectPosition point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), -540,
                -84);
        double nodata = 0;
        double result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), -540 - res, -84);
        result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), -540 + res, -84);
View Full Code Here

                -84);
        double nodata = 0;
        double result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), -540 - res, -84);
        result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), -540 + res, -84);
        result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);
View Full Code Here

        Assert.assertNotEquals(nodata, result, TOLERANCE);
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), -540 - res, -84);
        result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);
        point = new DirectPosition2D(mosaic.getCoordinateReferenceSystem(), -540 + res, -84);
        result = ((byte[]) mosaic.evaluate(point))[0];
        Assert.assertNotEquals(nodata, result, TOLERANCE);

        // Coverage and RenderedImage disposal
        mosaic.dispose(true);
        disposeCoveragePlanarImage(mosaic);
View Full Code Here

            ReferencedEnvelope env = new ReferencedEnvelope(source.getEnvelope2D());
            DirectPosition2D trPos =
                    InfoToolHelperUtils.getTransformed(pos, getContentToLayerTransform());

            if (env.contains(trPos)) {
                Object objArray = source.evaluate(trPos);
                Number[] bandValues = InfoToolHelperUtils.asNumberArray(objArray);

                if (bandValues != null) {
                    result.newFeature("Raw values");
                    for (int i = 0; i < bandValues.length; i++) {
View Full Code Here

        double sum = 0.0;
        for (int i = 0; i < width; i++) {
            for (int j = 0; j < height; j++) {
                GridCoordinates2D gridCoordinate = new GridCoordinates2D(i, j);
                float[] band = new float[1];
                float[] result = grid.evaluate(gridCoordinate, band);
                sum = sum + result[0];
            }
        }
        return sum;
    }
View Full Code Here

        saveFootprintProperties(p);
        GridCoverage2D coverage = readCoverage();
        // check the footprints have been applied by pocking the output image
        byte[] pixel = new byte[3];
        // Close to San Marino, black if we have the insets
        coverage.evaluate(new DirectPosition2D(12.54, 44.03), pixel);
        assertEquals(0, pixel[0]);
        assertEquals(0, pixel[1]);
        assertEquals(0, pixel[2]);
        // Golfo di La Spezia, should be black
        coverage.evaluate(new DirectPosition2D(9.12, 44.25), pixel);
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.