Package net.opengis.wcs11

Examples of net.opengis.wcs11.DescribeCoverageType


        // set the version attribute on the request
        if (kvp.containsKey("version")) {
            AcceptVersionsType acceptVersions = Ows11Factory.eINSTANCE.createAcceptVersionsType();
            acceptVersions.getVersion().add(kvp.get("version"));

            GetCapabilitiesType getCapabilities = (GetCapabilitiesType) request;
            getCapabilities.setAcceptVersions(acceptVersions);
        }

        return request;
    }
View Full Code Here


                (operation.getService().getVersion().toString().equals("1.1.0") ||
                        operation.getService().getVersion().toString().equals("1.1.1"));
    }

    public String getMimeType(Object value, Operation operation) {
        GetCapabilitiesType request = (GetCapabilitiesType) OwsUtils.parameter(operation
                .getParameters(), GetCapabilitiesType.class);

        if ((request != null) && (request.getAcceptFormats() != null)) {
            //look for an accepted format
            List formats = request.getAcceptFormats().getOutputFormat();

            for (Iterator f = formats.iterator(); f.hasNext();) {
                String format = (String) f.next();

                if (format.endsWith("/xml")) {
View Full Code Here

    }

    @Override
    protected void qualifyRequest(WorkspaceInfo ws, LayerInfo l, Operation operation, Request request) {
     
        GetCapabilitiesType caps = parameter(operation, GetCapabilitiesType.class);
        if (caps != null) {
            return;
        }
       
        DescribeCoverageType dcov = parameter(operation, DescribeCoverageType.class);
View Full Code Here

                + "<wcs:GetCapabilities service=\"WCS\" "
                + "xmlns:ows=\"http://www.opengis.net/ows/1.1\" "
                + "xmlns:wcs=\"http://www.opengis.net/wcs/1.1.1\" "
                + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>";
        // smoke test, we only try out a very basic request
        GetCapabilitiesType cap = (GetCapabilitiesType) reader.read(null,
                new StringReader(request), null);
        assertEquals("WCS", cap.getService());
    }
View Full Code Here

                "<ows:AcceptFormats>" + //
                "  <ows:OutputFormat>text/xml</ows:OutputFormat>" + //
                "</ows:AcceptFormats>" + //
                "</wcs:GetCapabilities>";
//        System.out.println(request);
        GetCapabilitiesType cap = (GetCapabilitiesType) reader.read(null,
                new StringReader(request), null);
        assertEquals("WCS", cap.getService());
        assertEquals(1, cap.getAcceptVersions().getVersion().size());
        assertEquals("1.0.0", (String) cap.getAcceptVersions().getVersion().get(0));
        assertEquals(1, cap.getSections().getSection().size());
        assertEquals("Section1", (String) cap.getSections().getSection().get(0));
        assertEquals(1, cap.getAcceptFormats().getOutputFormat().size());
        assertEquals("text/xml", (String) cap.getAcceptFormats().getOutputFormat().get(0));
    }
View Full Code Here

        return multipart.getContentType().replace("mixed", "related");
    }

    @Override
    public String[][] getHeaders(Object value, Operation operation) throws ServiceException {
        final GetCoverageType request = (GetCoverageType) operation.getParameters()[0];
        final String identifier = request.getIdentifier().getValue();
        return new String[][] { { "Content-Disposition",
                "attachment;filename=\"" + identifier.replace(':', '_') + ".eml\"" } };
    }
View Full Code Here

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

    public void write(Object value, OutputStream output, Operation operation) throws IOException,
            ServiceException {
        GridCoverage[] coverages = (GridCoverage[]) value;

        // grab the delegate for coverage encoding
        GetCoverageType request = (GetCoverageType) operation.getParameters()[0];
        String outputFormat = request.getOutput().getFormat();
        CoverageResponseDelegate delegate = CoverageResponseDelegateFactory
                .encoderFor(outputFormat);
        if (delegate == null)
            throw new WcsException("Could not find encoder for output format " + outputFormat);

        // grab the coverage info for Coverages document encoding
        final GridCoverage2D coverage = (GridCoverage2D) coverages[0];
        CoverageInfo coverageInfo = catalog.getCoverageByName(request.getIdentifier().getValue());

        // use javamail classes to actually encode the document
        try {
            // coverages xml structure (always set the headers after the data
            // handlers, setting
View Full Code Here

        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

        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

TOP

Related Classes of net.opengis.wcs11.DescribeCoverageType

Copyright © 2018 www.massapicom. 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.