public void testElevationFirst() throws Exception { String request = getWaterTempElevationRequest("0.0"); MockHttpServletResponse response = postAsServletResponse("wcs", request); assertEquals("image/tiff;subtype=\"geotiff\"", response.getContentType()); // same result as time first checkTimeCurrent(response); }
public void testElevationSecond() throws Exception { String request = getWaterTempElevationRequest("100.0"); MockHttpServletResponse response = postAsServletResponse("wcs", request); assertEquals("image/tiff;subtype=\"geotiff\"", response.getContentType()); // save File tiffFile = File.createTempFile("wcs", "", new File("target")); IOUtils.copy(getBinaryInputStream(response), new FileOutputStream(tiffFile)); // make sure we can read the coverage back GeoTiffReader reader = new GeoTiffReader(tiffFile); GridCoverage2D result = reader.read(null); /* gdallocationinfo NCOM_wattemp_100_20081101T0000000_12.tiff 10 10 Report: Location: (10P,10L) Band 1: Value: 13.337999683572 */ // check a pixel double[] pixel = new double[1]; result.getRenderedImage().getData().getPixel(10, 10, pixel); assertEquals(13.337999683572, pixel[0], 1e-6); tiffFile.delete(); }
@Test public void testElevationFirst() throws Exception { String request = getWaterTempElevationRequest("0.0"); MockHttpServletResponse response = postAsServletResponse("wcs", request); assertEquals("image/tiff", response.getContentType()); // same result as time first checkPixelValue(response, 10, 10, 18.2849999185419); request = request.replace("ELEVATION", "elevation"); response = postAsServletResponse("wcs", request); assertEquals("image/tiff", response.getContentType()); checkPixelValue(response, 10, 10, 18.2849999185419); }
@Test public void testElevationSecond() throws Exception { String request = getWaterTempElevationRequest("100.0"); MockHttpServletResponse response = postAsServletResponse("wcs", request); assertEquals("image/tiff", response.getContentType()); /* gdallocationinfo NCOM_wattemp_100_20081101T0000000_12.tiff 10 10 Report: Location: (10P,10L) Band 1: Value: 13.337999683572 */ checkPixelValue(response, 10, 10, 13.337999683572); request = request.replace("ELEVATION", "elevation"); response = postAsServletResponse("wcs", request); assertEquals("image/tiff", response.getContentType()); checkPixelValue(response, 10, 10, 13.337999683572); }