Package net.opengis.wps10

Examples of net.opengis.wps10.DataType


        // create a polygon for the input
        WKTReader reader = new WKTReader(new GeometryFactory());
        Geometry geom1 = (Polygon) reader.read("POLYGON((20 10, 30 0, 40 10, 30 20, 20 10))");

        // create and set the input on the exe request
        DataType input = WPSUtils.createInputDataType(geom1, idt);
        List<EObject> list = new ArrayList<EObject>();
        list.add(input);
        exeRequest.addInput(idt.getIdentifier().getValue(), list);
    }
View Full Code Here


        // create and set the input on the exe request
        if (idt.getIdentifier().getValue().equalsIgnoreCase("geom"))
        {
            // set geom inputs
            List<EObject> list = new ArrayList<EObject>();
            DataType input = WPSUtils.createInputDataType(geom1, WPSUtils.INPUTTYPE_COMPLEXDATA, "application/wkt");
            DataType input2 = WPSUtils.createInputDataType(geom2, WPSUtils.INPUTTYPE_COMPLEXDATA, "application/wkt");
            DataType input3 = WPSUtils.createInputDataType(geom3, WPSUtils.INPUTTYPE_COMPLEXDATA, "application/wkt");
            DataType input4 = WPSUtils.createInputDataType(geom4, WPSUtils.INPUTTYPE_COMPLEXDATA, "application/wkt");
            list.add(input);
            list.add(input2);
            list.add(input3);
            list.add(input4);
            exeRequest.addInput(idt.getIdentifier().getValue(), list);
View Full Code Here

        Double d1 = 77.84;
        Double d2 = 40039.229;

        // create and set the input on the exe request
        List<EObject> list = new ArrayList<EObject>();
        DataType input = WPSUtils.createInputDataType(d1, idt);
        list.add(input);
        exeRequest.addInput(idt.getIdentifier().getValue(), list);

        InputDescriptionType idt2 = (InputDescriptionType) pdt.getDataInputs().getInput().get(1);
        List<EObject> list2 = new ArrayList<EObject>();
        DataType input2 = WPSUtils.createInputDataType(d2, idt2);
        list2.add(input2);
        exeRequest.addInput(idt2.getIdentifier().getValue(), list2);

    }
View Full Code Here

     * @param schema
     *            only used for type complexdata
     * @return the created DataType input object
     */
    public static DataType createInputDataType(Object obj, int type, String schema, String mimeType) {
        DataType dt = Wps10Factory.eINSTANCE.createDataType();

        if (type == INPUTTYPE_LITERAL)
        {

            LiteralDataType ldt = Wps10Factory.eINSTANCE.createLiteralDataType();
            ldt.setValue(obj.toString());
            dt.setLiteralData(ldt);
        }
        else
        {
            // assume complex data
            ComplexDataType cdt = Wps10Factory.eINSTANCE.createComplexDataType();

            // do I need to add a FeatureMap object, or Entry object, or what?
            // EStructuralFeature eStructuralFeature = null;
            // Entry createEntry = FeatureMapUtil.createEntry(eStructuralFeature, obj);
            // cdt.getMixed().add(obj);
            cdt.getData().add(obj);

            if (schema != null)
            {
                cdt.setSchema(schema);
            }
            if(mimeType != null) {
                cdt.setMimeType(mimeType);
            }
            dt.setComplexData(cdt);
        }

        return dt;
    }
View Full Code Here

        Iterator iterator = outputs.iterator();
        while (iterator.hasNext())
        {
            OutputDataType odt = (OutputDataType) iterator.next();
            DataType data = odt.getData();
            ComplexDataType complexData = data.getComplexData();
            LiteralDataType literalData = data.getLiteralData();
            if (literalData != null)
            {
                // use the converters api to try and create an object of the type
                // we want (default to the String value if it failed).
                Object value = literalData.getValue();
View Full Code Here

                while (iterator2.hasNext())
                {
                    // identifier
                    EObject oInput = iterator2.next();
                    if (oInput instanceof DataType) {
                      DataType dt = (DataType) oInput;
                      InputType input = Wps10Factory.eINSTANCE.createInputType();
                      CodeType ct = Ows11Factory.eINSTANCE.createCodeType();
                      ct.setValue((String) key);
                      input.setIdentifier(ct);
                      input.setData((DataType) dt);
View Full Code Here

        // if our value is some sort of collection, then created multiple
        // dataTypes for this inputdescriptiontype.
        List<EObject> list = new ArrayList<EObject>();
        if (inputValue instanceof Map) {
          for (Object inVal : ((Map)inputValue).values()) {
            DataType createdInput = WPSUtils.createInputDataType(inVal, idt);
            list.add(createdInput);
          }
        } else if (inputValue instanceof Collection) {
          for (Object inVal : (Collection)inputValue) {
            DataType createdInput = WPSUtils.createInputDataType(inVal, idt);
            list.add(createdInput);
          }
        } else {
          // our value is a single object so create a single datatype for it
          DataType createdInput = WPSUtils.createInputDataType(inputValue, idt);
          list.add(createdInput);
        }
        // add the input to the execute request
        exeRequest.addInput(identifier, list);
      }
View Full Code Here

    }

    @Override
    public DataType createLiteralInputValue(String literalValue)
    {
        DataType literalInputValue = wpsFactory.createDataType();
        LiteralDataType literalDataType = wpsFactory.createLiteralDataType();
        literalDataType.setValue(literalValue);
        literalInputValue.setLiteralData(literalDataType);

        return literalInputValue;
    }
View Full Code Here

    @Override
    public DataType createBoundingBoxInputValue(String crs, int dimensions, List<Double> lowerCorner,
        List<Double> upperCorner)
    {
        DataType bbox = wpsFactory.createDataType();
        BoundingBoxType bboxType = Ows11Factory.eINSTANCE.createBoundingBoxType();
        bboxType.setCrs(crs);
        bboxType.setDimensions(BigInteger.valueOf(dimensions));
        bboxType.setLowerCorner(lowerCorner);
        bboxType.setUpperCorner(upperCorner);
        bbox.setBoundingBoxData(bboxType);

        return bbox;
    }
View Full Code Here

        ex.setDataInputs(inputs);

        InputType in = f.createInputType();
        inputs.getInput().add(in);

        DataType data = f.createDataType();
        in.setData(data);

        ComplexDataType cd = f.createComplexDataType();
        data.setComplexData(cd);

        //cd.getData().add(new GeometryFactory().createPoint(new Coordinate(1, 2)));

        Encoder e = new Encoder(new WPSConfiguration());
        e.setIndenting(true);
View Full Code Here

TOP

Related Classes of net.opengis.wps10.DataType

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.