Package org.geoserver.wps.process

Examples of org.geoserver.wps.process.RawData


    @DescribeResult(name = "result", description = "Output raster", meta = {
            "mimeTypes=application/json,text/xml", "chosenMimeType=outputMimeType" })
    public RawData execute(
            @DescribeParameter(name = "data", description = "Input features", meta = { "mimeTypes=application/json,text/xml" }) final RawData input,
            @DescribeParameter(name = "outputMimeType", min = 0) final String outputMimeType) {
        return new RawData() {

            @Override
            public String getMimeType() {
                return outputMimeType;
            }
View Full Code Here


        }
    }

    @Override
    public void encode(Object value, OutputStream os) throws Exception {
        RawData rd = (RawData) value;
        IOUtils.copy(rd.getInputStream(), os);
    }
View Full Code Here

                kvp.put("version", "1.0.0");
                kvp.put("request", "GetExecutionResult");
                kvp.put("executionId", executionId);
                kvp.put("outputId", file.getName());
                if(o instanceof RawData) {
                  RawData rawData = (RawData) o;
                  kvp.put("mimetype", rawData.getMimeType());
                } else {
                  kvp.put("mimetype", cppio.getMimeType());
                }
                outputReference.setHref(ResponseUtils.buildURL(request.getBaseUrl(), "ows", kvp, URLType.SERVICE));
                outputReference.setMimeType(cppio.getMimeType());
            } else {
                // encode as data
                DataType data = f.createDataType();
                output.setData(data);

                if (ppio instanceof LiteralPPIO) {
                    LiteralDataType literal = f.createLiteralDataType();
                    data.setLiteralData(literal);

                    literal.setValue(((LiteralPPIO) ppio).encode(o));
                } else if (ppio instanceof BoundingBoxPPIO) {
                    BoundingBoxType bbox = ((BoundingBoxPPIO) ppio).encode(o);
                    data.setBoundingBoxData(bbox);
                } else if (ppio instanceof ComplexPPIO) {
                    ComplexDataType complex = f.createComplexDataType();
                    data.setComplexData(complex);

                    ComplexPPIO cppio = (ComplexPPIO) ppio;
                    complex.setMimeType(cppio.getMimeType());

                    if (cppio instanceof RawDataPPIO) {
                        RawData rawData = (RawData) o;
                        complex.setMimeType(rawData.getMimeType());
                        complex.setEncoding("base64");
                        complex.getData().add(new RawDataEncoderDelegate(rawData));
                    } else if (cppio instanceof XMLPPIO) {
                        // encode directly
                        complex.getData().add(new XMLEncoderDelegate((XMLPPIO) cppio, o));
View Full Code Here

TOP

Related Classes of org.geoserver.wps.process.RawData

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.