String outputFormat = request.getOutput().getFormat(); CoverageResponseDelegate delegate = CoverageResponseDelegateFactory .encoderFor(outputFormat);
private OutputType parseOutputElement(Map kvp) throws Exception { final OutputType output = Wcs111Factory.eINSTANCE.createOutputType(); output.setGridCRS(Wcs111Factory.eINSTANCE.createGridCrsType()); // check and set store Boolean store = (Boolean) kvp.get("store"); if (store != null) output.setStore(store.booleanValue()); // check and set format String format = (String) kvp.get("format"); if (format == null) throw new WcsException("format parameter is mandatory", MissingParameterValue, "format"); output.setFormat(format); // set the other gridcrs properties final GridCrsType gridCRS = output.getGridCRS(); gridCRS.setGridBaseCRS((String) kvp.get("gridBaseCrs")); gridCRS.setGridType((String) kvp.get("gridType")); gridCRS.setGridCS((String) kvp.get("gridCS")); gridCRS.setGridOrigin((Double[]) kvp.get("GridOrigin")); gridCRS.setGridOffsets((Double[]) kvp.get("GridOffsets")); return output; }
@Override public boolean canHandle(Operation operation) { // this one can handle GetCoverage responses where store = false if(!(operation.getParameters()[0] instanceof GetCoverageType)) return false; GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0]; return !getCoverage.getOutput().isStore(); }
@Test public void testBasic() throws Exception { Map<String, Object> raw = baseMap(); final String layerId = getLayerId(TASMANIA_BM); raw.put("identifier", layerId); raw.put("format", "image/tiff"); raw.put("BoundingBox", "-45,146,-42,147"); raw.put("store", "false"); raw.put("GridBaseCRS", "urn:ogc:def:crs:EPSG:6.6:4326"); GetCoverageType getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); assertEquals(layerId, getCoverage.getIdentifier().getValue()); assertEquals("image/tiff", getCoverage.getOutput().getFormat()); assertFalse(getCoverage.getOutput().isStore()); assertEquals( "urn:ogc:def:crs:EPSG:6.6:4326", getCoverage.getOutput().getGridCRS().getGridBaseCRS()); }
return; String format = output.getFormat(); String declaredFormat = getDeclaredFormat(meta.getSupportedFormats(), format); if (declaredFormat == null) InvalidParameterValue, "format"); final GridCrsType gridCRS = output.getGridCRS(); if (gridCRS != null) {
final GridCrsType gridCRS = request.getOutput().getGridCRS();
private WCS2GetCoverageRequestBuilder() { getCoverageType = Wcs20Factory.eINSTANCE.createGetCoverageType(); wcs111GetCoverage = Wcs11Factory.eINSTANCE.createGetCoverageType(); wcs111GetCoverage.setVersion("1.1.1"); OutputType outputType = Wcs11Factory.eINSTANCE.createOutputType(); outputType.setFormat("image/tiff"); wcs111GetCoverage.setOutput(outputType); getCoverageType.setVersion("2.0.0"); getCoverageType.setFormat("image/tiff"); }
if (output == null) return; String format = output.getFormat(); String declaredFormat = getDeclaredFormat(meta.getSupportedFormats(), format); if (declaredFormat == null) "format"); final GridCrsType gridCRS = output.getGridCRS(); if (gridCRS != null) {
final GridCrsType gridCRS = request.getOutput().getGridCRS();
private OutputType parseOutputElement(Map kvp) throws Exception { final OutputType output = Wcs111Factory.eINSTANCE.createOutputType(); output.setGridCRS(Wcs111Factory.eINSTANCE.createGridCrsType()); if (store != null) output.setStore(store.booleanValue()); throw new WcsException( "format parameter is mandatory", MissingParameterValue, "format"); output.setFormat(format); final GridCrsType gridCRS = output.getGridCRS(); gridCRS.setGridBaseCRS((String) kvp.get("gridBaseCrs"));
assertEquals( Arrays.asList(90.0, 180.0), gc.getDomainSubset().getBoundingBox().getUpperCorner()); assertEquals("image/tiff", gc.getOutput().getFormat()); assertNull(gc.getOutput().getGridCRS());
@Test public void testGridCS() throws Exception { Map<String, Object> raw = baseMap(); final String layerId = getLayerId(TASMANIA_BM); raw.put("identifier", layerId); raw.put("format", "image/tiff"); raw.put("BoundingBox", "-45,146,-42,147"); raw.put("GridCS", GridCS.GCSGrid2dSquare.getXmlConstant()); GetCoverageType getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); assertEquals( GridCS.GCSGrid2dSquare.getXmlConstant(), getCoverage.getOutput().getGridCRS().getGridCS()); raw.put("GridCS", GridCS.GCSGrid2dSquare.getXmlConstant().toUpperCase()); getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); assertEquals( GridCS.GCSGrid2dSquare.getXmlConstant(), getCoverage.getOutput().getGridCRS().getGridCS()); raw.put("GridCS", "Hoolabaloola"); try { reader.read(reader.createRequest(), parseKvp(raw), raw); fail("We should have had a WcsException here?"); } catch (WcsException e) { assertEquals(InvalidParameterValue.name(), e.getCode()); assertEquals("GridCS", e.getLocator()); } }
@Override public boolean canHandle(Operation operation) { // this one can handle GetCoverage responses where store = false if (!(operation.getParameters()[0] instanceof GetCoverageType)) return false; GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0]; return !getCoverage.getOutput().isStore(); }
String outputFormat = request.getOutput().getFormat(); CoverageResponseDelegate delegate = responseFactory.encoderFor(outputFormat); if (delegate == null)
GetCoverageType getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw); Double[] offsets = (Double[]) getCoverage.getOutput().getGridCRS().getGridOffsets(); assertEquals(2, offsets.length); assertEquals(0, Double.compare(10.5, (double) offsets[0]));
@Override public boolean canHandle(Operation operation) { // this one can handle GetCoverage responses where store = false if (!(operation.getParameters()[0] instanceof GetCoverageType)) return false; GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0]; return getCoverage.getOutput().isStore(); }
String outputFormat = request.getOutput().getFormat(); CoverageResponseDelegate delegate = CoverageResponseDelegateFactory .encoderFor(outputFormat);
final GridCrsType gridCRS = gc.getOutput().getGridCRS(); assertEquals("urn:ogc:def:crs:EPSG:6.6:4326", gridCRS.getGridBaseCRS()); assertEquals("urn:ogc:def:method:WCS:1.1:2dSimpleGrid", gridCRS.getGridType());
@Override public boolean canHandle(Operation operation) { // this one can handle GetCoverage responses where store = false if(!(operation.getParameters()[0] instanceof GetCoverageType)) return false; GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0]; return getCoverage.getOutput().isStore(); }
String outputFormat = request.getOutput().getFormat(); CoverageResponseDelegate delegate = responseFactory.encoderFor(outputFormat); if (delegate == null)