Package org.opengis.coverage.grid

Examples of org.opengis.coverage.grid.GridCoverage.evaluate()


        ArcGridFormat format = new ArcGridFormat();
        GridCoverage gc = format.getReader(is).read(null);
       
        assertTrue(new Envelope(-145.4, 145.6, -41.8, -42.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        double[] valueInside = (double[]) gc.evaluate(new DirectPosition2D(145.55, -42));
        assertEquals(615.0, valueInside[0]);
        double[] valueOutside = (double[]) gc.evaluate(new DirectPosition2D(145.57, -41.9));
        // this should really be NaN...
        assertEquals(0.0, valueOutside[0]);
View Full Code Here


       
        assertTrue(new Envelope(-145.4, 145.6, -41.8, -42.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        double[] valueInside = (double[]) gc.evaluate(new DirectPosition2D(145.55, -42));
        assertEquals(615.0, valueInside[0]);
        double[] valueOutside = (double[]) gc.evaluate(new DirectPosition2D(145.57, -41.9));
        // this should really be NaN...
        assertEquals(0.0, valueOutside[0]);

    }
}
View Full Code Here

        ArcGridFormat format = new ArcGridFormat();
        GridCoverage gc = format.getReader(is).read(null);
       
        assertTrue(new Envelope(-145.4, 145.6, -41.8, -42.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        double[] valueInside = (double[]) gc.evaluate(new DirectPosition2D(145.55, -42));
        assertEquals(615.0, valueInside[0]);
        double[] valueOutside = (double[]) gc.evaluate(new DirectPosition2D(145.57, -41.9));
        // this should really be NaN...
        assertEquals(0.0, valueOutside[0]);
    }
View Full Code Here

       
        assertTrue(new Envelope(-145.4, 145.6, -41.8, -42.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        double[] valueInside = (double[]) gc.evaluate(new DirectPosition2D(145.55, -42));
        assertEquals(615.0, valueInside[0]);
        double[] valueOutside = (double[]) gc.evaluate(new DirectPosition2D(145.57, -41.9));
        // this should really be NaN...
        assertEquals(0.0, valueOutside[0]);
    }
}
View Full Code Here

        ArcGridFormat format = new ArcGridFormat();
        GridCoverage gc = format.getReader(is).read(null);
       
        assertTrue(new Envelope(144.9, 146.1, -40.9, -43.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        addToSameCoverageValue = (double[]) gc.evaluate(new DirectPosition2D(145.9584, -41.6587));
        assertEquals(1978.0, addToSameCoverageValue[0], DELTA);
    }
   
    @Test
    public void testMultiplyOperation() throws Exception {
View Full Code Here

        ArcGridFormat format = new ArcGridFormat();
        GridCoverage gc = format.getReader(is).read(null);
       
        assertTrue(new Envelope(144.9, 146.1, -40.9, -43.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        multiplyForSameCoverageValue = (double[]) gc.evaluate(new DirectPosition2D(145.9584, -41.6587));
        assertEquals(978121.0, multiplyForSameCoverageValue[0], DELTA);
    }
   
    @Test
    public void testIncompatibleGridCoverages() throws Exception {
View Full Code Here

        ArcGridFormat format = new ArcGridFormat();
        GridCoverage gc = format.getReader(is).read(null);
       
        assertTrue(new Envelope(144.9, 146.1, -40.9, -43.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        double[] valueOnRangeA = (double[]) gc.evaluate(new DirectPosition2D(145.55, -42));
        double[] valueOnRangeB = (double[]) gc.evaluate(new DirectPosition2D(145.9584, -41.6587));
        double[] valueOutsideRange = (double[]) gc.evaluate(new DirectPosition2D(145.22, -42.66));
       
        assertEquals(50.0, valueOnRangeA[0], DELTA);
        assertEquals(110.0, valueOnRangeB[0], DELTA);
View Full Code Here

        GridCoverage gc = format.getReader(is).read(null);
       
        assertTrue(new Envelope(144.9, 146.1, -40.9, -43.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        double[] valueOnRangeA = (double[]) gc.evaluate(new DirectPosition2D(145.55, -42));
        double[] valueOnRangeB = (double[]) gc.evaluate(new DirectPosition2D(145.9584, -41.6587));
        double[] valueOutsideRange = (double[]) gc.evaluate(new DirectPosition2D(145.22, -42.66));
       
        assertEquals(50.0, valueOnRangeA[0], DELTA);
        assertEquals(110.0, valueOnRangeB[0], DELTA);
        assertEquals(0.0, valueOutsideRange[0], DELTA);
View Full Code Here

       
        assertTrue(new Envelope(144.9, 146.1, -40.9, -43.1).contains(new ReferencedEnvelope(gc.getEnvelope())));
       
        double[] valueOnRangeA = (double[]) gc.evaluate(new DirectPosition2D(145.55, -42));
        double[] valueOnRangeB = (double[]) gc.evaluate(new DirectPosition2D(145.9584, -41.6587));
        double[] valueOutsideRange = (double[]) gc.evaluate(new DirectPosition2D(145.22, -42.66));
       
        assertEquals(50.0, valueOnRangeA[0], DELTA);
        assertEquals(110.0, valueOnRangeB[0], DELTA);
        assertEquals(0.0, valueOutsideRange[0], DELTA);
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.