Examples of GetCoverageType


Examples of net.opengis.wcs11.GetCoverageType

    /**
     * Runs GetCoverage on the specified parameters and returns an array of coverages
     */
    protected GridCoverage[] executeGetCoverageXml(String request) throws Exception {
        GetCoverageType getCoverage = (GetCoverageType) xmlReader.read(null, new StringReader(
                request), null);
        return service.getCoverage(getCoverage);
    }
View Full Code Here

Examples of net.opengis.wcs11.GetCoverageType

        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());
    }
View Full Code Here

Examples of net.opengis.wcs11.GetCoverageType

        raw.put("identifier", layerId);
        raw.put("format", "image/tiff");
        raw.put("BoundingBox", "-45,146,-42,147");

        raw.put("gridType", GridType.GT2dGridIn2dCrs.getXmlConstant());
        GetCoverageType getCoverage = (GetCoverageType) reader.read(reader.createRequest(),
                parseKvp(raw), raw);
        assertEquals(GridType.GT2dGridIn2dCrs.getXmlConstant(), getCoverage.getOutput()
                .getGridCRS().getGridType());

        raw.put("gridType", GridType.GT2dSimpleGrid.getXmlConstant());
        getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw);
        assertEquals(GridType.GT2dSimpleGrid.getXmlConstant(), getCoverage.getOutput().getGridCRS()
                .getGridType());
       
        // try with different case
        raw.put("gridType", GridType.GT2dSimpleGrid.getXmlConstant().toUpperCase());
        getCoverage = (GetCoverageType) reader.read(reader.createRequest(), parseKvp(raw), raw);
        assertEquals(GridType.GT2dSimpleGrid.getXmlConstant(), getCoverage.getOutput().getGridCRS()
                .getGridType());

        raw.put("gridType", GridType.GT2dGridIn3dCrs.getXmlConstant());
        try {
            reader.read(reader.createRequest(), parseKvp(raw), raw);
View Full Code Here

Examples of net.opengis.wcs11.GetCoverageType

                "  <wcs:Output format=\"image/tiff\"/>\r\n" + //
                "</wcs:GetCoverage>";
//        System.out.println(request);

        // smoke test, we only try out a very basic request
        GetCoverageType gc = (GetCoverageType) reader.read(null, new StringReader(
                request), null);
        assertEquals("WCS", gc.getService());
        assertEquals("1.1.1", gc.getVersion());
        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());
    }
View Full Code Here

Examples of net.opengis.wcs11.GetCoverageType

            "    </wcs:FieldSubset>\r\n" + //
            "  </wcs:RangeSubset>\r\n" + //
            "  <wcs:Output format=\"image/tiff\"/>\r\n" + //
            "</wcs:GetCoverage>";
       
        GetCoverageType gc = (GetCoverageType) reader.read(null, new StringReader(
                request), null);
        assertEquals(1, gc.getRangeSubset().getFieldSubset().size());
        FieldSubsetType field = (FieldSubsetType) gc.getRangeSubset().getFieldSubset().get(0);
        assertEquals("BlueMarble", field.getIdentifier().getValue());
        assertEquals("bicubic", field.getInterpolationType());
        assertEquals(1, field.getAxisSubset().size());
        AxisSubsetType axis = (AxisSubsetType) field.getAxisSubset().get(0);
        assertEquals("Bands", axis.getIdentifier());
View Full Code Here

Examples of net.opengis.wcs11.GetCoverageType

            "      <wcs:GridCS>urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS</wcs:GridCS>\r\n" + //
            "    </wcs:GridCRS>\r\n" + //
            "  </wcs:Output>\r\n" + //
            "</wcs:GetCoverage>";
       
        GetCoverageType gc = (GetCoverageType) reader.read(null, new StringReader(
                request), null);
        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());
        assertEquals("urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS", gridCRS.getGridCS());
        System.out.println(gridCRS.getGridOrigin().getClass() + ": " + gridCRS.getGridOrigin());
        assertTrue(Arrays.equals(new Double[] {10.0, 20.0}, (Double[]) gridCRS.getGridOrigin()));
View Full Code Here

Examples of net.opengis.wcs11.GetCoverageType

        this.catalog = catalog;
    }

    @Override
    public Object read(Object request, Map kvp, Map rawKvp) throws Exception {
        GetCoverageType getCoverage = (GetCoverageType) super.read(request, kvp, rawKvp);

        // grab coverage info to perform further checks
        if (getCoverage.getIdentifier() == null)
            throw new WcsException("identifier parameter is mandatory", MissingParameterValue,
                    "identifier");

        // build the domain subset
        getCoverage.setDomainSubset(parseDomainSubset(kvp));

        // build output element
        getCoverage.setOutput(parseOutputElement(kvp));

        return getCoverage;
    }
View Full Code Here

Examples of net.opengis.wcs20.GetCoverageType

    Parser parser = new Parser(new WCSConfiguration());

    @Test
    public void testParseGetCoverageSlicing() throws Exception {
        String capRequestPath = "requestGetCoverageSlicing.xml";
        GetCoverageType gc = (GetCoverageType) parser.parse(getClass()
                .getResourceAsStream(capRequestPath));
        assertEquals("WCS", gc.getService());
        assertEquals("2.0.1", gc.getVersion());

        // coverage id
        assertEquals("C0001", gc.getCoverageId());
       
        // slicing
        EList<DimensionSubsetType> dss = gc.getDimensionSubset();
        assertEquals(2, dss.size());
        DimensionSliceType ds1 = (DimensionSliceType) dss.get(0);
        assertEquals("Long", ds1.getDimension());
        assertEquals("1", ds1.getSlicePoint());
        DimensionSliceType ds2 = (DimensionSliceType) dss.get(1);
        assertEquals("Lat", ds2.getDimension());
        assertEquals("1", ds2.getSlicePoint());
       
        // format
        assertEquals("application/gml+xml", gc.getFormat());
    }
View Full Code Here

Examples of net.opengis.wcs20.GetCoverageType

    }
   
    @Test
    public void testParseGetCoverageTrimming() throws Exception {
        String capRequestPath = "requestGetCoverageTrimming.xml";
        GetCoverageType gc = (GetCoverageType) parser.parse(getClass()
                .getResourceAsStream(capRequestPath));
        assertEquals("WCS", gc.getService());
        assertEquals("2.0.1", gc.getVersion());

        // coverage id
        assertEquals("C0001", gc.getCoverageId());
       
        // trimming
        EList<DimensionSubsetType> dss = gc.getDimensionSubset();
        assertEquals(2, dss.size());
        DimensionTrimType dt1 = (DimensionTrimType) dss.get(0);
        assertEquals("Long", dt1.getDimension());
        assertEquals("1", dt1.getTrimLow());
        assertEquals("2", dt1.getTrimHigh());
        DimensionTrimType dt2 = (DimensionTrimType) dss.get(1);
        assertEquals("Lat", dt2.getDimension());
        assertEquals("1", dt2.getTrimLow());
        assertEquals("2", dt2.getTrimHigh());

        // format
        assertEquals("application/gml+xml", gc.getFormat());
        assertEquals("multipart/related", gc.getMediaType());
    }
View Full Code Here

Examples of net.opengis.wcs20.GetCoverageType

    }
   
    @Test
    public void testParseGetCoverageTrimmingSlicing() throws Exception {
        String capRequestPath = "requestGetCoverageTrimmingSlicing.xml";
        GetCoverageType gc = (GetCoverageType) parser.parse(getClass()
                .getResourceAsStream(capRequestPath));
        assertEquals("WCS", gc.getService());
        assertEquals("2.0.1", gc.getVersion());

        // coverage id
        assertEquals("C0001", gc.getCoverageId());
       
        // trimming
        EList<DimensionSubsetType> dss = gc.getDimensionSubset();
        assertEquals(2, dss.size());
        DimensionTrimType dt = (DimensionTrimType) dss.get(0);
        assertEquals("Long", dt.getDimension());
        assertEquals("20", dt.getTrimLow());
        assertEquals("29", dt.getTrimHigh());
        DimensionSliceType ds = (DimensionSliceType) dss.get(1);
        assertEquals("Lat", ds.getDimension());
        assertEquals("1", ds.getSlicePoint());

        // format
        assertEquals("application/gml+xml", gc.getFormat());
        assertEquals("multipart/related", gc.getMediaType());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.