Package net.opengis.wcs20

Examples of net.opengis.wcs20.GetCoverageType


    @SuppressWarnings("unchecked")
    protected GetCoverageType parse(String url) throws Exception {
        Map<String, Object> rawKvp = new CaseInsensitiveMap(KvpUtils.parseQueryString(url));
        Map<String, Object> kvp = new CaseInsensitiveMap(parseKvp(rawKvp));
        WCS20GetCoverageRequestReader reader = new WCS20GetCoverageRequestReader();
        GetCoverageType gc = (GetCoverageType) reader.createRequest();
        return (GetCoverageType) reader.read(gc, kvp, rawKvp);
    }
View Full Code Here


        if (!(firstParam instanceof GetCoverageType)) {
            // we only handle WCS 2.0 requests
            return false;
        }

        GetCoverageType getCoverage = (GetCoverageType) firstParam;

        // this class only handles encoding the coverage with mediatype
        String mediaType = getCoverage.getMediaType();
        return mediaType != null && mediaType.equals("multipart/related");
    }
View Full Code Here

    public void write(Object value, OutputStream output, Operation operation) throws IOException {
        // grab the coverage
        GridCoverage2D coverage = (GridCoverage2D) value;

        // grab the format
        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String format = getCoverage.getFormat();
        if (format == null) {
            format = "image/tiff";
        }

        // extract additional extensions
        final Map<String, String> encodingParameters = new HashMap<String, String>();
        final ExtensionType extension = getCoverage.getExtension();
        if (extension != null) {
            final EList<ExtensionItemType> extensions = extension.getContents();
            for (ExtensionItemType ext : extensions) {
                encodingParameters.put(ext.getName(), ext.getSimpleContent());
            }
        }

        // grab the delegate
        CoverageResponseDelegate delegate = responseFactory.encoderFor(format);

        // use javamail classes to actually encode the document
        try {
            MimeMultipart multipart = new MimeMultipart();
            multipart.setSubType("related");
           
            String fileName = "/coverages/" + getCoverage.getCoverageId() + "." + delegate.getFileExtension(format);
           
            // coverages xml structure, which is very close to the DescribeFeatureType output
            BodyPart coveragesPart = new MimeBodyPart();
            FileReference reference = new FileReference(fileName, delegate.getMimeType(format), delegate.getConformanceClass(format));
            final CoverageData coveragesData = new CoverageData(coverage, reference, envelopeDimensionsMapper);
View Full Code Here

    }

    @Override
    public String getAttachmentFileName(Object value, Operation operation) {
        // the only thing that can open this format normally available on a desktop is a e-mail client
        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        return getCoverage.getCoverageId() + ".eml";
    }
View Full Code Here

        super(GridCoverage.class);
        this.responseFactory = responseFactory;
    }

    public String getMimeType(Object value, Operation operation) {
        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String format = getCoverage.getFormat();
        if (format == null) {
            return "image/tiff";
        } else {
            CoverageResponseDelegate delegate = responseFactory.encoderFor(format);
            if (delegate == null) {
View Full Code Here

        if (!(firstParam instanceof GetCoverageType)) {
            // we only handle WCS 2.0 requests
            return false;
        }

        GetCoverageType getCoverage = (GetCoverageType) firstParam;
        // this class only handles encoding the coverage in its output format
        return getCoverage.getMediaType() == null;
    }
View Full Code Here

    public void write(Object value, OutputStream output, Operation operation) throws IOException {
        // grab the coverage
        GridCoverage2D coverage = (GridCoverage2D) value;
       
        // grab the format
        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String format = getCoverage.getFormat();
        if (format == null) {
            format = "image/tiff";
        }
       
        // extract additional extensions
        final Map<String,String> encodingParameters= new HashMap<String,String>();       
        final ExtensionType extension = getCoverage.getExtension();
        if(extension!=null){
            final EList<ExtensionItemType> extensions = extension.getContents();
            for(ExtensionItemType ext:extensions){
                encodingParameters.put(ext.getName(),ext.getSimpleContent());
            }           
View Full Code Here

    }
   
    @Override
    public String getAttachmentFileName(Object value, Operation operation) {
        // grab the format
        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String format = getCoverage.getFormat();
        if (format == null) {
            format = "image/tiff";
        }
       
        // grab the delegate and thus the extension
        CoverageResponseDelegate delegate = responseFactory.encoderFor(format);
        String extension = delegate.getFileExtension(format);
       
        // collect the name of the coverages that have been requested
        return getCoverage.getCoverageId() + "." + extension;
    }
View Full Code Here

public class GetCoverageKvpTest extends WCSKVPTestSupport {

    @Test
    public void testParseBasic() throws Exception {
        GetCoverageType gc = parse("wcs?request=GetCoverage&service=WCS&version=2.0.1&coverageId=theCoverage");
       
        assertEquals("theCoverage", gc.getCoverageId());
    }
View Full Code Here

        assertEquals("theCoverage", gc.getCoverageId());
    }
   
    @Test
    public void testExtensionScaleFactor() throws Exception {
        GetCoverageType gc = parse("wcs?request=GetCoverage&service=WCS&version=2.0.1" +
                "&coverageId=theCoverage&scaleFactor=2");
       
        Map<String, Object> extensions = getExtensionsMap(gc);

        assertEquals(1, extensions.size());
View Full Code Here

TOP

Related Classes of net.opengis.wcs20.GetCoverageType

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.