@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); testData.addRasterLayer(MOSAIC, "raster-filter-test.zip", null, getCatalog()); testData.addRasterLayer(RAIN, "rain.zip", "asc", getCatalog()); testData.addRasterLayer( SPATIO_TEMPORAL, "spatio-temporal.zip", null, null, SystemTestData.class, getCatalog()); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); testData.addRasterLayer(MOSAIC, "raster-filter-test.zip", null, getCatalog()); testData.addRasterLayer( SPATIO_TEMPORAL, "spatio-temporal.zip", null, null, SystemTestData.class, getCatalog()); testData.addRasterLayer( new QName(MockData.WCS_URI, "category", MockData.WCS_PREFIX), "category.tiff", null, getCatalog()); // enable dimensions on the water temperature layer setupRasterDimension(WATTEMP, ResourceInfo.TIME, DimensionPresentation.LIST, null); setupRasterDimension(WATTEMP, ResourceInfo.ELEVATION, DimensionPresentation.LIST, null); }
@Test public void testRequestDisabledResource() throws Exception { Catalog catalog = getCatalog(); ResourceInfo tazbm = catalog.getResourceByName(getLayerId(MockData.TASMANIA_BM), ResourceInfo.class); try { tazbm.setEnabled(false); catalog.save(tazbm); String queryString = "&request=getcoverage&service=wcs&version=1.0.0&format=image/geotiff&bbox=146,-45,147,-42" + "&crs=EPSG:4326&width=150&height=150"; Document dom = getAsDOM("wcs?sourcecoverage=" + TASMANIA_BM.getLocalPart() + queryString); // print(dom); assertEquals("ServiceExceptionReport", dom.getDocumentElement().getNodeName()); } finally { tazbm.setEnabled(true); catalog.save(tazbm); } }
@Test public void testReproject() throws Exception { Catalog catalog = getCatalog(); final String layerId = getLayerId(TASMANIA_BM); CoverageInfo ci = catalog.getCoverageByName(layerId);
@Test public void testCategoriesToArray() throws Exception { CoverageInfo myCoverage = getCatalog().getCoverageByName("category"); GridCoverage gridCoverage = myCoverage.getGridCoverage(null, null); MultiplyConst op = new MultiplyConst(); final ParameterValueGroup param = op.getParameters(); param.parameter("Source").setValue(gridCoverage); param.parameter("constants").setValue(new double[] {0.1}); boolean exception = false; try { op.doOperation(param, null); } catch (Exception e) { exception = true; } assertFalse(exception); }
CoverageInfo ci = getCatalog().getCoverageByName(TASMANIA_BM.getLocalPart()); GridCoverage2D original = (GridCoverage2D) ci.getGridCoverage(null, null); coverages.add(original);