@Test public void testWCS10GetCoverageDifferentCrs() throws Exception { // xMin,yMin 5988504.35,851278.90 : xMax,yMax 7585113.55,1950872.01 // xMin,yMin -95.1193,42.2802 : xMax,yMax -71.295,53.73 GetCoverageType gc = Wcs10Factory.eINSTANCE.createGetCoverageType(); net.opengis.wcs10.SpatialSubsetType spatialSubset = Wcs10Factory.eINSTANCE.createSpatialSubsetType(); CoordinateReferenceSystem crs = CRS.decode("EPSG:3348", false); CoordinateReferenceSystem logCrs = CRS.decode("EPSG:4326", false); GeneralEnvelope env = new GeneralEnvelope( new double[] {5988504.35, 851278.90}, new double[] {7585113.55, 1950872.01}); env.setCoordinateReferenceSystem(crs); BoundingBox bbox = new ReferencedEnvelope(42.2802, 53.73, -95.1193, -71.295, logCrs); spatialSubset.getEnvelope().clear(); spatialSubset.getEnvelope().add(env); net.opengis.wcs10.DomainSubsetType domainSubset = Wcs10Factory.eINSTANCE.createDomainSubsetType(); domainSubset.setSpatialSubset(spatialSubset); gc.setSourceCoverage("acme:foo"); gc.setDomainSubset(domainSubset); callback.operationDispatched(new Request(), op("GetCoverage", "WCS", "1.0.0", gc)); assertEquals("acme:foo", data.getResources().get(0)); BBoxAsserts.assertEqualsBbox(bbox, data.getBbox(), 0.1); }
@Test public void testWCS10GetCoverage() throws Exception { GetCoverageType gc = Wcs10Factory.eINSTANCE.createGetCoverageType(); net.opengis.wcs10.SpatialSubsetType spatialSubset = Wcs10Factory.eINSTANCE.createSpatialSubsetType(); CoordinateReferenceSystem crs = CRS.decode("EPSG:4326"); GeneralEnvelope env = new GeneralEnvelope(new double[] {-123.4, 48.2}, new double[] {-120.9, 50.1}); env.setCoordinateReferenceSystem(crs); BoundingBox bbox = new ReferencedEnvelope(env); spatialSubset.getEnvelope().clear(); spatialSubset.getEnvelope().add(env); net.opengis.wcs10.DomainSubsetType domainSubset = Wcs10Factory.eINSTANCE.createDomainSubsetType(); domainSubset.setSpatialSubset(spatialSubset); gc.setSourceCoverage("acme:foo"); gc.setDomainSubset(domainSubset); callback.operationDispatched(new Request(), op("GetCoverage", "WCS", "1.0.0", gc)); assertEquals("acme:foo", data.getResources().get(0)); BBoxAsserts.assertEqualsBbox(bbox, data.getBbox(), 0.1); }
@Test public void testBasic() throws Exception { Map<String, Object> raw = baseMap(); final String layerId = getLayerId(TASMANIA_BM); raw.put("SourceCoverage", layerId); raw.put("version", "1.0.0"); raw.put("format", "image/tiff"); raw.put("BBOX", "-45,146,-42,147"); raw.put("CRS", "EPSG:4326"); raw.put("width", "150"); raw.put("height", "150"); GetCoverageType getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); assertEquals(layerId, getCoverage.getSourceCoverage()); assertEquals("image/tiff", getCoverage.getOutput().getFormat().getValue()); assertEquals("EPSG:4326", getCoverage.getOutput().getCrs().getValue()); }
@Test public void testInterpolation() throws Exception { Map<String, Object> raw = baseMap(); String layerId = getLayerId(TASMANIA_BM); raw.put("SourceCoverage", layerId); raw.put("version", "1.0.0"); raw.put("format", "image/tiff"); raw.put("BBOX", "-45,146,-42,147"); raw.put("CRS", "EPSG:4326"); raw.put("width", "150"); raw.put("height", "150"); raw.put("interpolation", "nearest neighbor"); GetCoverageType getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); assertEquals(layerId, getCoverage.getSourceCoverage()); assertEquals("image/tiff", getCoverage.getOutput().getFormat().getValue()); assertEquals("nearest neighbor", getCoverage.getInterpolationMethod().toString()); // bilinear raw = baseMap(); raw.put("SourceCoverage", layerId); raw.put("version", "1.0.0"); raw.put("format", "image/tiff"); raw.put("BBOX", "-45,146,-42,147"); raw.put("CRS", "EPSG:4326"); raw.put("width", "150"); raw.put("height", "150"); raw.put("interpolation", "bilinear"); getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); assertEquals(layerId, getCoverage.getSourceCoverage()); assertEquals("image/tiff", getCoverage.getOutput().getFormat().getValue()); assertEquals("bilinear", getCoverage.getInterpolationMethod().toString()); // nearest raw = baseMap(); raw.put("SourceCoverage", layerId); raw.put("version", "1.0.0"); raw.put("format", "image/tiff"); raw.put("BBOX", "-45,146,-42,147"); raw.put("CRS", "EPSG:4326"); raw.put("width", "150"); raw.put("height", "150"); raw.put("interpolation", "nearest"); getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); assertEquals(layerId, getCoverage.getSourceCoverage()); assertEquals("image/tiff", getCoverage.getOutput().getFormat().getValue()); assertEquals("nearest neighbor", getCoverage.getInterpolationMethod().toString()); // bicubic raw = baseMap(); raw.put("SourceCoverage", layerId); raw.put("version", "1.0.0"); raw.put("format", "image/tiff"); raw.put("BBOX", "-45,146,-42,147"); raw.put("CRS", "EPSG:4326"); raw.put("width", "150"); raw.put("height", "150"); raw.put("interpolation", "bicubic"); getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); assertEquals(layerId, getCoverage.getSourceCoverage()); assertEquals("image/tiff", getCoverage.getOutput().getFormat().getValue()); assertEquals("bicubic", getCoverage.getInterpolationMethod().toString()); }