Search in sources :

Example 1 with SupportedCRSsType

use of net.opengis.wps10.SupportedCRSsType in project sldeditor by robward-scisys.

the class GeoServerWPSClient method getOutputParameter.

/**
 * Gets the output parameter.
 *
 * @param typeOfData the type of data
 * @param processOutputs the process outputs
 * @return the output parameter
 */
private boolean getOutputParameter(DataTypeEnum typeOfData, ProcessOutputsType processOutputs) {
    for (Object o : processOutputs.getOutput()) {
        if (o instanceof OutputDescriptionType) {
            OutputDescriptionType oo = (OutputDescriptionType) o;
            LiteralOutputType literal = oo.getLiteralOutput();
            if (literal != null) {
                DomainMetadataType dataType = literal.getDataType();
                if (dataType != null) {
                // System.out.println(dataType.getValue() + "/" + dataType.getReference());
                }
            } else {
                SupportedCRSsType bbox = oo.getBoundingBoxOutput();
                if (bbox != null) {
                // System.out.println(bbox);
                } else {
                    SupportedComplexDataType complex = oo.getComplexOutput();
                    if (complex != null) {
                        ComplexDataCombinationsType parameterDataType = complex.getSupported();
                        if (isGeometry(typeOfData, parameterDataType)) {
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
Also used : DomainMetadataType(net.opengis.ows11.DomainMetadataType) SupportedCRSsType(net.opengis.wps10.SupportedCRSsType) OutputDescriptionType(net.opengis.wps10.OutputDescriptionType) SupportedComplexDataType(net.opengis.wps10.SupportedComplexDataType) LiteralOutputType(net.opengis.wps10.LiteralOutputType) ComplexDataCombinationsType(net.opengis.wps10.ComplexDataCombinationsType)

Example 2 with SupportedCRSsType

use of net.opengis.wps10.SupportedCRSsType in project sldeditor by robward-scisys.

the class GeoServerWPSClient method getInputParameter.

/**
 * Gets the input parameter.
 *
 * @param typeOfData the type of data
 * @param dataInputs the data inputs
 * @return the input parameter
 */
@SuppressWarnings("unused")
private boolean getInputParameter(DataTypeEnum typeOfData, DataInputsType dataInputs) {
    for (Object dataInput : dataInputs.getInput()) {
        InputDescriptionType input = (InputDescriptionType) dataInput;
        if (input instanceof InputDescriptionType) {
            InputDescriptionType inputDescription = (InputDescriptionType) input;
            LiteralInputType literal = inputDescription.getLiteralData();
            if (literal != null) {
                DomainMetadataType dataType = literal.getDataType();
            // System.out.println(dataType.getValue() + "/" + dataType.getReference());
            } else {
                SupportedCRSsType bbox = inputDescription.getBoundingBoxData();
                if (bbox != null) {
                // System.out.println(bbox);
                } else {
                    SupportedComplexDataType complex = inputDescription.getComplexData();
                    if (complex != null) {
                        ComplexDataCombinationsType parameterDataType = complex.getSupported();
                        if (isGeometry(typeOfData, parameterDataType)) {
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
Also used : DomainMetadataType(net.opengis.ows11.DomainMetadataType) InputDescriptionType(net.opengis.wps10.InputDescriptionType) SupportedCRSsType(net.opengis.wps10.SupportedCRSsType) SupportedComplexDataType(net.opengis.wps10.SupportedComplexDataType) LiteralInputType(net.opengis.wps10.LiteralInputType) ComplexDataCombinationsType(net.opengis.wps10.ComplexDataCombinationsType)

Example 3 with SupportedCRSsType

use of net.opengis.wps10.SupportedCRSsType in project sldeditor by robward-scisys.

the class CustomProcessFunctionTest method createProcessDescriptionBBox.

/**
 * Test the process description boundaing box values.
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void createProcessDescriptionBBox() {
    ProcessDescriptionType process = Wps10FactoryImpl.init().createProcessDescriptionType();
    CodeType codeType = Ows11FactoryImpl.init().createCodeType();
    codeType.setValue("JTS:area");
    process.setIdentifier(codeType);
    InputDescriptionType inputDescription = Wps10FactoryImpl.init().createInputDescriptionType();
    CodeType codeType2 = Ows11FactoryImpl.init().createCodeType();
    codeType2.setValue("dummyParameter");
    inputDescription.setIdentifier(codeType2);
    inputDescription.setMinOccurs(BigInteger.valueOf(1));
    inputDescription.setMaxOccurs(BigInteger.valueOf(1));
    DataInputsType dataInputs = Wps10FactoryImpl.init().createDataInputsType();
    EList dataInputList = dataInputs.getInput();
    dataInputList.add(inputDescription);
    process.setDataInputs(dataInputs);
    SupportedCRSsType crs = Wps10FactoryImpl.init().createSupportedCRSsType();
    inputDescription.setBoundingBoxData(crs);
    CustomProcessFunction obj = new CustomProcessFunction();
    List<ProcessFunctionParameterValue> valueList = obj.extractParameters(process);
    assertEquals(1, valueList.size());
    ProcessFunctionParameterValue value = valueList.get(0);
    assertEquals(1, value.minOccurences);
    assertEquals(1, value.maxOccurences);
    assertTrue(value.dataType.compareTo("BBOX") == 0);
    SupportedComplexDataInputType complex = Wps10FactoryImpl.init().createSupportedComplexDataInputType();
    inputDescription.setComplexData(complex);
    inputDescription.setBoundingBoxData(null);
    valueList = obj.extractParameters(process);
    assertEquals(1, valueList.size());
    value = valueList.get(0);
    assertEquals(1, value.minOccurences);
    assertEquals(1, value.maxOccurences);
    assertTrue(value.dataType.compareTo("Geometry") == 0);
}
Also used : InputDescriptionType(net.opengis.wps10.InputDescriptionType) EList(org.eclipse.emf.common.util.EList) SupportedCRSsType(net.opengis.wps10.SupportedCRSsType) ProcessDescriptionType(net.opengis.wps10.ProcessDescriptionType) DataInputsType(net.opengis.wps10.DataInputsType) ProcessFunctionParameterValue(com.sldeditor.rendertransformation.ProcessFunctionParameterValue) CustomProcessFunction(com.sldeditor.rendertransformation.CustomProcessFunction) CodeType(net.opengis.ows11.CodeType) SupportedComplexDataInputType(net.opengis.wps10.SupportedComplexDataInputType) Test(org.junit.Test)

Aggregations

SupportedCRSsType (net.opengis.wps10.SupportedCRSsType)3 DomainMetadataType (net.opengis.ows11.DomainMetadataType)2 ComplexDataCombinationsType (net.opengis.wps10.ComplexDataCombinationsType)2 InputDescriptionType (net.opengis.wps10.InputDescriptionType)2 SupportedComplexDataType (net.opengis.wps10.SupportedComplexDataType)2 CustomProcessFunction (com.sldeditor.rendertransformation.CustomProcessFunction)1 ProcessFunctionParameterValue (com.sldeditor.rendertransformation.ProcessFunctionParameterValue)1 CodeType (net.opengis.ows11.CodeType)1 DataInputsType (net.opengis.wps10.DataInputsType)1 LiteralInputType (net.opengis.wps10.LiteralInputType)1 LiteralOutputType (net.opengis.wps10.LiteralOutputType)1 OutputDescriptionType (net.opengis.wps10.OutputDescriptionType)1 ProcessDescriptionType (net.opengis.wps10.ProcessDescriptionType)1 SupportedComplexDataInputType (net.opengis.wps10.SupportedComplexDataInputType)1 EList (org.eclipse.emf.common.util.EList)1 Test (org.junit.Test)1