use of net.opengis.swes.x20.DescribeSensorResponseDocument 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;
}
Aggregations