Search in sources :

Example 1 with DescribeSensorResponseType

use of net.opengis.swes.x20.DescribeSensorResponseType in project arctic-sea by 52North.

the class DescribeSensorResponseEncoder method create.

@Override
protected XmlObject create(DescribeSensorResponse response) throws EncodingException {
    DescribeSensorResponseDocument doc = DescribeSensorResponseDocument.Factory.newInstance(getXmlOptions());
    DescribeSensorResponseType dsr = doc.addNewDescribeSensorResponse();
    dsr.setProcedureDescriptionFormat(response.getOutputFormat());
    for (SosProcedureDescription<?> sosProcedureDescription : response.getProcedureDescriptions()) {
        SensorDescriptionType sensorDescription = dsr.addNewDescription().addNewSensorDescription();
        sensorDescription.addNewData().set(getSensorDescription(response, sosProcedureDescription));
        if (sosProcedureDescription.isSetValidTime()) {
            XmlObject xoValidTime = encodeObjectToXml(GmlConstants.NS_GML_32, sosProcedureDescription.getValidTime());
            XmlObject substitution = sensorDescription.addNewValidTime().addNewAbstractTimeGeometricPrimitive().substitute(GmlHelper.getGml321QnameForITime(sosProcedureDescription.getValidTime()), xoValidTime.schemaType());
            substitution.set(xoValidTime);
        }
    }
    // in a single observation the gml:ids must be unique
    if (response.getProcedureDescriptions().size() > 1) {
        XmlHelper.makeGmlIdsUnique(doc.getDomNode());
    }
    return doc;
}
Also used : DescribeSensorResponseDocument(net.opengis.swes.x20.DescribeSensorResponseDocument) DescribeSensorResponseType(net.opengis.swes.x20.DescribeSensorResponseType) XmlObject(org.apache.xmlbeans.XmlObject) SensorDescriptionType(net.opengis.swes.x20.SensorDescriptionType)

Aggregations

DescribeSensorResponseDocument (net.opengis.swes.x20.DescribeSensorResponseDocument)1 DescribeSensorResponseType (net.opengis.swes.x20.DescribeSensorResponseType)1 SensorDescriptionType (net.opengis.swes.x20.SensorDescriptionType)1 XmlObject (org.apache.xmlbeans.XmlObject)1