コード例 #1
0
  @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);
  }
コード例 #2
0
  @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);
  }