Package org.geoserver.wcs.responses

Examples of org.geoserver.wcs.responses.CoverageResponseDelegate


            throw new WcsException("Cannot handle object of type: "
                    + operation.getParameters()[0].getClass());

        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String outputFormat = getCoverage.getOutput().getFormat().getValue();
        CoverageResponseDelegate delegate = getResponseDelegate(outputFormat);
        return getCoverage.getSourceCoverage() + "." + delegate.getFileExtension(outputFormat);
    }
View Full Code Here


            throw new WcsException("Cannot handle object of type: "
                    + operation.getParameters()[0].getClass());

        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String outputFormat = getCoverage.getOutput().getFormat().getValue();
        CoverageResponseDelegate delegate = getResponseDelegate(outputFormat);

        return delegate.getMimeType(outputFormat);
    }
View Full Code Here

        return delegate.getMimeType(outputFormat);
    }

    private CoverageResponseDelegate getResponseDelegate(String outputFormat) {
        CoverageResponseDelegate delegate = responseFactory.encoderFor(outputFormat);
        if (delegate == null) {
            throw new WcsException("Could not find encoder for output format " + outputFormat);
        }
        return delegate;
    }
View Full Code Here

        if (!(operation.getParameters()[0] instanceof GetCoverageType))
            return false;

        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String outputFormat = getCoverage.getOutput().getFormat().getValue();
        CoverageResponseDelegate delegate = getResponseDelegate(outputFormat);

        return delegate.canProduce(outputFormat);
    }
View Full Code Here

        GridCoverage[] coverages = (GridCoverage[]) value;

        // grab the delegate for coverage encoding
        GetCoverageType request = (GetCoverageType) operation.getParameters()[0];
        String outputFormat = request.getOutput().getFormat().getValue();
        CoverageResponseDelegate delegate = getResponseDelegate(outputFormat);

        // grab the coverage info for Coverages document encoding
        final GridCoverage2D coverage = (GridCoverage2D) coverages[0];
        // ImageIOUtilities.visualize(coverage.getRenderedImage());

        // write the coverage
        try {
            delegate.encode(coverage, outputFormat,Collections.EMPTY_MAP, output);
            output.flush();
        } finally {
            // if(output != null) output.close();
        }
    }
View Full Code Here

            Set<String> formats = new LinkedHashSet<String>();
            for (Iterator it = ci.getSupportedFormats().iterator(); it.hasNext();) {
                String format = (String) it.next();
                // wcs 1.1 requires mime types, not format names
                try  {
                    CoverageResponseDelegate delegate = responseFactory.encoderFor(format);
                    String formatMime = delegate.getMimeType(format);
                    if(formatMime != null)
                        formats.add(formatMime);
                } catch(Exception e) {
                    // no problem, we just want to avoid people writing HALLABALOOLA in the
                    // supported formats section of the coverage config and then break the
View Full Code Here

            // formats are part of the document only starting version 2.0.1
            if(ct.getAcceptVersions() == null || ct.getAcceptVersions().getVersion() == null
                    || ct.getAcceptVersions().getVersion().isEmpty() || ct.getAcceptVersions().getVersion().contains("2.0.1")) {
                Set<String> formats = new TreeSet<String>();
                for (String format : responseFactory.getOutputFormats()) {
                    CoverageResponseDelegate delegate = responseFactory.encoderFor(format);
                    String mime = delegate.getMimeType(format);
                    try {
                        new URI(mime);
                        formats.add(mime);
                    } catch(URISyntaxException e) {
                        // skip it
View Full Code Here

TOP

Related Classes of org.geoserver.wcs.responses.CoverageResponseDelegate

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.