private DomainSubsetType parseDomainSubset(Map kvp) { final DomainSubsetType domainSubset = Wcs111Factory.eINSTANCE.createDomainSubsetType(); // either bbox or timesequence must be there BoundingBoxType bbox = (BoundingBoxType) kvp.get("BoundingBox"); TimeSequenceType timeSequence = (TimeSequenceType) kvp.get("TemporalSubset"); if (timeSequence == null && bbox == null) throw new WcsException( "Bounding box cannot be null, TimeSequence has not been specified", WcsExceptionCode.MissingParameterValue, "BoundingBox"); domainSubset.setBoundingBox(bbox); domainSubset.setTemporalSubset(timeSequence); return domainSubset; }
@Test public void testWCS11GetCoverageDifferentCrs() throws Exception { net.opengis.wcs11.GetCoverageType gc = Wcs11Factory.eINSTANCE.createGetCoverageType(); //xMin,yMin 5988504.35,851278.90 : xMax,yMax 7585113.55,1950872.01 //xMin,yMin -95.1193,42.2802 : xMax,yMax -71.295,53.73 CoordinateReferenceSystem logCrs = CRS.decode("EPSG:4326", false); BoundingBox bbox = new ReferencedEnvelope(42.2802, 53.73, -95.1193, -71.295, logCrs); net.opengis.ows11.BoundingBoxType wcsBbox = net.opengis.ows11.Ows11Factory.eINSTANCE.createBoundingBoxType(); wcsBbox.setLowerCorner(Arrays.asList(5988504.35d,851278.90d)); wcsBbox.setUpperCorner(Arrays.asList(7585113.55d,1950872.01d)); wcsBbox.setCrs("urn:ogc:def:crs:EPSG:3348"); net.opengis.wcs11.DomainSubsetType domainSubset = Wcs11Factory.eINSTANCE.createDomainSubsetType(); domainSubset.setBoundingBox(wcsBbox); gc.setDomainSubset(domainSubset); CodeType c = Ows11Factory.eINSTANCE.createCodeType(); c.setValue("acme:bar"); gc.setIdentifier(c); callback.operationDispatched(new Request(), op("GetCoverage", "WCS", "1.1.0", gc)); assertEquals("acme:bar", data.getResources().get(0)); BBoxAsserts.assertEqualsBbox(bbox, data.getBbox(), 0.1); }
private void checkDomainSubset(CoverageInfo meta, DomainSubsetType domainSubset) throws Exception { BoundingBoxType bbox = domainSubset.getBoundingBox();
final BoundingBoxType bbox = request.getDomainSubset().getBoundingBox(); final CoordinateReferenceSystem nativeCRS = originalEnvelope.getCoordinateReferenceSystem(); TimeSequenceType temporalSubset = request.getDomainSubset().getTemporalSubset();
@Test public void testWCS11GetCoverageDifferentCrs() throws Exception { net.opengis.wcs11.GetCoverageType gc = Wcs11Factory.eINSTANCE.createGetCoverageType(); // xMin,yMin 5988504.35,851278.90 : xMax,yMax 7585113.55,1950872.01 // xMin,yMin -95.1193,42.2802 : xMax,yMax -71.295,53.73 CoordinateReferenceSystem logCrs = CRS.decode("EPSG:4326", false); BoundingBox bbox = new ReferencedEnvelope(42.2802, 53.73, -95.1193, -71.295, logCrs); net.opengis.ows11.BoundingBoxType wcsBbox = net.opengis.ows11.Ows11Factory.eINSTANCE.createBoundingBoxType(); wcsBbox.setLowerCorner(Arrays.asList(5988504.35d, 851278.90d)); wcsBbox.setUpperCorner(Arrays.asList(7585113.55d, 1950872.01d)); wcsBbox.setCrs("urn:ogc:def:crs:EPSG:3348"); net.opengis.wcs11.DomainSubsetType domainSubset = Wcs11Factory.eINSTANCE.createDomainSubsetType(); domainSubset.setBoundingBox(wcsBbox); gc.setDomainSubset(domainSubset); CodeType c = Ows11Factory.eINSTANCE.createCodeType(); c.setValue("acme:bar"); gc.setIdentifier(c); callback.operationDispatched(new Request(), op("GetCoverage", "WCS", "1.1.0", gc)); assertEquals("acme:bar", data.getResources().get(0)); BBoxAsserts.assertEqualsBbox(bbox, data.getBbox(), 0.1); }
private void checkDomainSubset(CoverageInfo meta, DomainSubsetType domainSubset, WCSInfo wcs) throws Exception { BoundingBoxType bbox = domainSubset.getBoundingBox();
@Test public void testWCS11GetCoverage() throws Exception { net.opengis.wcs11.GetCoverageType gc = Wcs11Factory.eINSTANCE.createGetCoverageType(); CoordinateReferenceSystem crs = CRS.decode("EPSG:4326"); GeneralEnvelope env = new GeneralEnvelope(new double[]{48.2, -123.4}, new double[]{50.1, -120.9}); env.setCoordinateReferenceSystem(crs); BoundingBox bbox = new ReferencedEnvelope(env); net.opengis.ows11.BoundingBoxType wcsBbox = net.opengis.ows11.Ows11Factory.eINSTANCE.createBoundingBoxType(); wcsBbox.setLowerCorner(Arrays.asList(48.2d, -123.4d)); wcsBbox.setUpperCorner(Arrays.asList(50.1d, -120.9d)); //wcsBbox.setCrs("urn:ogc:def:crs:OGC:1.3:CRS84"); wcsBbox.setCrs("urn:ogc:def:crs:EPSG:4326"); net.opengis.wcs11.DomainSubsetType domainSubset = Wcs11Factory.eINSTANCE.createDomainSubsetType(); domainSubset.setBoundingBox(wcsBbox); gc.setDomainSubset(domainSubset); CodeType c = Ows11Factory.eINSTANCE.createCodeType(); c.setValue("acme:bar"); gc.setIdentifier(c); callback.operationDispatched(new Request(), op("GetCoverage", "WCS", "1.1.0", gc)); assertEquals("acme:bar", data.getResources().get(0)); BBoxAsserts.assertEqualsBbox(bbox, data.getBbox(), 0.1); }
private DomainSubsetType parseDomainSubset(Map kvp) { final DomainSubsetType domainSubset = Wcs111Factory.eINSTANCE.createDomainSubsetType(); // either bbox or timesequence must be there BoundingBoxType bbox = (BoundingBoxType) kvp.get("BoundingBox"); TimeSequenceType timeSequence = (TimeSequenceType) kvp.get("TimeSequence"); if (timeSequence == null && bbox == null) throw new WcsException( "Bounding box cannot be null, TimeSequence has not been specified", WcsExceptionCode.MissingParameterValue, "BoundingBox"); domainSubset.setBoundingBox(bbox); domainSubset.setTemporalSubset(timeSequence); return domainSubset; }
final BoundingBoxType bbox = request.getDomainSubset().getBoundingBox(); final CoordinateReferenceSystem nativeCRS = originalEnvelope .getCoordinateReferenceSystem();
@Test public void testWCS11GetCoverage() throws Exception { net.opengis.wcs11.GetCoverageType gc = Wcs11Factory.eINSTANCE.createGetCoverageType(); CoordinateReferenceSystem crs = CRS.decode("EPSG:4326"); GeneralEnvelope env = new GeneralEnvelope(new double[] {48.2, -123.4}, new double[] {50.1, -120.9}); env.setCoordinateReferenceSystem(crs); BoundingBox bbox = new ReferencedEnvelope(env); net.opengis.ows11.BoundingBoxType wcsBbox = net.opengis.ows11.Ows11Factory.eINSTANCE.createBoundingBoxType(); wcsBbox.setLowerCorner(Arrays.asList(48.2d, -123.4d)); wcsBbox.setUpperCorner(Arrays.asList(50.1d, -120.9d)); // wcsBbox.setCrs("urn:ogc:def:crs:OGC:1.3:CRS84"); wcsBbox.setCrs("urn:ogc:def:crs:EPSG:4326"); net.opengis.wcs11.DomainSubsetType domainSubset = Wcs11Factory.eINSTANCE.createDomainSubsetType(); domainSubset.setBoundingBox(wcsBbox); gc.setDomainSubset(domainSubset); CodeType c = Ows11Factory.eINSTANCE.createCodeType(); c.setValue("acme:bar"); gc.setIdentifier(c); callback.operationDispatched(new Request(), op("GetCoverage", "WCS", "1.1.0", gc)); assertEquals("acme:bar", data.getResources().get(0)); BBoxAsserts.assertEqualsBbox(bbox, data.getBbox(), 0.1); }
assertEquals("wcs:BlueMarble", gc.getIdentifier().getValue()); assertEquals( "urn:ogc:def:crs:EPSG:6.6:4326", gc.getDomainSubset().getBoundingBox().getCrs()); assertEquals( Arrays.asList(-90.0, -180.0), gc.getDomainSubset().getBoundingBox().getLowerCorner()); assertEquals( Arrays.asList(90.0, 180.0), gc.getDomainSubset().getBoundingBox().getUpperCorner()); assertEquals("image/tiff", gc.getOutput().getFormat()); assertNull(gc.getOutput().getGridCRS());
/** * Sets a lat/lon bounding box. * * @param minLat * @param maxLat * @param minLon * @param maxLon */ public WCS2GetCoverageRequestBuilder bbox( double minLon, double maxLon, double minLat, double maxLat) { DimensionTrimType latTrim = Wcs20Factory.eINSTANCE.createDimensionTrimType(); latTrim.setCRS("http://www.opengis.net/def/crs/EPSG/0/4326"); latTrim.setTrimLow(minLat + ""); latTrim.setTrimHigh(maxLat + ""); latTrim.setDimension("Lat"); getCoverageType.getDimensionSubset().add(latTrim); DimensionTrimType lonTrim = Wcs20Factory.eINSTANCE.createDimensionTrimType(); lonTrim.setCRS("http://www.opengis.net/def/crs/EPSG/0/4326"); lonTrim.setTrimLow(minLon + ""); lonTrim.setTrimHigh(maxLon + ""); lonTrim.setDimension("Long"); getCoverageType.getDimensionSubset().add(lonTrim); DomainSubsetType domainSubset = getWCS11DomainSubset(); BoundingBoxType boundingbox = Ows11Factory.eINSTANCE.createBoundingBoxType(); boundingbox.setCrs("http://www.opengis.net/def/crs/EPSG/0/4326"); boundingbox.setLowerCorner(Arrays.asList(minLat, minLon)); boundingbox.setUpperCorner(Arrays.asList(maxLat, maxLon)); domainSubset.setBoundingBox(boundingbox); return this; }