use of org.n52.shetland.ogc.gml.AbstractFeature in project arctic-sea by 52North.
the class OmDecoderv20 method getObservationConstellation.
private OmObservationConstellation getObservationConstellation(OMObservationType omot, Map<String, AbstractFeature> featureMap) throws DecodingException {
OmObservationConstellation observationConstellation = new OmObservationConstellation();
observationConstellation.setObservationType(getObservationType(omot));
observationConstellation.setProcedure(createProcedure(omot));
observationConstellation.setObservableProperty(getObservableProperty(omot));
observationConstellation.setFeatureOfInterest(createFeatureOfInterest(omot, featureMap));
return observationConstellation;
}
use of org.n52.shetland.ogc.gml.AbstractFeature in project arctic-sea by 52North.
the class OmDecoderv20 method parseOmObservation.
private OmObservation parseOmObservation(OMObservationType omObservation) throws DecodingException {
Map<String, AbstractFeature> featureMap = Maps.newHashMap();
OmObservation sosObservation = new OmObservation();
// parse identifier, description
parseAbstractFeatureType(omObservation, sosObservation);
OmObservationConstellation observationConstallation = getObservationConstellation(omObservation, featureMap);
sosObservation.setObservationConstellation(observationConstallation);
sosObservation.setResultTime(getResultTime(omObservation));
sosObservation.setValidTime(getValidTime(omObservation));
if (omObservation.getParameterArray() != null) {
sosObservation.setParameter(parseNamedValueTypeArray(omObservation.getParameterArray()));
}
sosObservation.setValue(getObservationValue(omObservation));
return sosObservation;
}
use of org.n52.shetland.ogc.gml.AbstractFeature in project arctic-sea by 52North.
the class SamplingDecoderv20 method parseSpatialSamplingFeature.
private AbstractFeature parseSpatialSamplingFeature(final SFSpatialSamplingFeatureType spatialSamplingFeature) throws DecodingException {
final SamplingFeature sosFeat = new SamplingFeature(null, spatialSamplingFeature.getId());
// parse identifier, names, description
parseAbstractFeatureType(spatialSamplingFeature, sosFeat);
sosFeat.setFeatureType(getFeatureType(spatialSamplingFeature.getType()));
sosFeat.setSampledFeatures(getSampledFeatures(spatialSamplingFeature.getSampledFeatureArray()));
sosFeat.setXml(getXmlDescription(spatialSamplingFeature));
sosFeat.setGeometry(getGeometry(spatialSamplingFeature.getShape()));
checkTypeAndGeometry(sosFeat);
sosFeat.setGmlId(spatialSamplingFeature.getId());
return sosFeat;
}
use of org.n52.shetland.ogc.gml.AbstractFeature in project arctic-sea by 52North.
the class AbstractOmEncoderv20 method encode.
@Override
public XmlObject encode(Object element, EncodingContext additionalValues) throws EncodingException {
XmlObject encodedObject = null;
if (element instanceof OmObservation) {
encodedObject = encodeOmObservation((OmObservation) element, additionalValues);
} else if (element instanceof NamedValue) {
NamedValueType nvt = createNamedValue((NamedValue<?>) element);
if (additionalValues.has(XmlBeansEncodingFlags.DOCUMENT)) {
NamedValueDocument nvd = NamedValueDocument.Factory.newInstance();
nvd.setNamedValue(nvt);
encodedObject = nvd;
} else if (additionalValues.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
NamedValuePropertyType nvpt = NamedValuePropertyType.Factory.newInstance();
nvpt.setNamedValue(nvt);
encodedObject = nvpt;
} else {
encodedObject = nvt;
}
} else if (element instanceof AbstractFeature) {
encodedObject = encodeFeatureOfInterest((AbstractFeature) element);
} else if (element instanceof SosProcedureDescription) {
encodedObject = encodeProcedureDescription((SosProcedureDescription<?>) element);
} else {
throw new UnsupportedEncoderInputException(this, element);
}
// XmlHelper.validateDocument(encodedObject));
return encodedObject;
}
use of org.n52.shetland.ogc.gml.AbstractFeature in project arctic-sea by 52North.
the class AbstractOmEncoderv20 method setFeatureOfInterest.
private void setFeatureOfInterest(OmObservation observation, OMObservationType xb) throws EncodingException {
AbstractFeature foi = observation.getObservationConstellation().getFeatureOfInterest();
XmlObject xbFoi = encodeFeatureOfInterest(foi);
xb.addNewFeatureOfInterest().set(xbFoi);
}
Aggregations