use of org.n52.shetland.ogc.om.features.FeatureCollection in project arctic-sea by 52North.
the class AqdEncoder method getFeatureCollection.
private FeatureCollection getFeatureCollection(GetObservationResponse response) throws EncodingException {
FeatureCollection featureCollection = new FeatureCollection();
featureCollection.setGmlId("fc_" + JavaHelper.generateID(new DateTime().toString()));
return featureCollection;
}
use of org.n52.shetland.ogc.om.features.FeatureCollection in project arctic-sea by 52North.
the class AqdGetObservationResponseEncoder method createFeatureCollection.
private FeatureCollection createFeatureCollection(GetObservationResponse response) throws EncodingException {
FeatureCollection featureCollection = new FeatureCollection();
featureCollection.setGmlId("fc_" + JavaHelper.generateID(new DateTime().toString()));
return featureCollection;
}
use of org.n52.shetland.ogc.om.features.FeatureCollection in project arctic-sea by 52North.
the class GetFeatureOfInterestResponseEncoder method create.
@Override
protected XmlObject create(GetFeatureOfInterestResponse response) throws EncodingException {
GetFeatureOfInterestResponseDocument document = GetFeatureOfInterestResponseDocument.Factory.newInstance(getXmlOptions());
GetFeatureOfInterestResponseType xbGetFoiResponse = document.addNewGetFeatureOfInterestResponse();
AbstractFeature feature = response.getAbstractFeature();
if (feature instanceof FeatureCollection) {
for (AbstractFeature f : (FeatureCollection) feature) {
addFeatureOfInterest(f, xbGetFoiResponse);
}
} else if (feature instanceof SamplingFeature) {
addFeatureOfInterest(feature, xbGetFoiResponse);
}
XmlHelper.makeGmlIdsUnique(document.getDomNode());
return document;
}
use of org.n52.shetland.ogc.om.features.FeatureCollection in project arctic-sea by 52North.
the class AbstractAqdResponseEncoder method processObservation.
protected void processObservation(OmObservation observation, TimePeriod timePeriod, TimeInstant resultTime, FeatureCollection featureCollection, AbstractEReportingHeader eReportingHeader, int counter) {
if (observation.isSetPhenomenonTime()) {
// generate gml:id
observation.setGmlId(getObservationId(counter));
// add xlink:href to eReportingHeader.content
eReportingHeader.addContent((AbstractFeature) new OmObservation().setIdentifier(new CodeWithAuthority(getObservationXlink(observation.getGmlId()))));
timePeriod.extendToContain(observation.getPhenomenonTime());
observation.setResultTime(resultTime);
featureCollection.addMember(observation);
}
}
use of org.n52.shetland.ogc.om.features.FeatureCollection in project arctic-sea by 52North.
the class GmlDecoderv321 method parseFeatureCollectionType.
private FeatureCollection parseFeatureCollectionType(FeatureCollectionType featureCollectionType) throws DecodingException {
final FeatureCollection feaColl = new FeatureCollection();
for (FeaturePropertyType feaPropType : featureCollectionType.getFeatureMemberArray()) {
Object decoded = decodeXmlElement(feaPropType);
feaColl.addMember((AbstractFeature) decoded);
}
return feaColl;
}
Aggregations