Search in sources :

Example 16 with FeatureCollection

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;
}
Also used : FeatureCollection(org.n52.shetland.ogc.om.features.FeatureCollection) DateTime(org.joda.time.DateTime)

Example 17 with 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;
}
Also used : FeatureCollection(org.n52.shetland.ogc.om.features.FeatureCollection) DateTime(org.joda.time.DateTime)

Example 18 with 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;
}
Also used : FeatureCollection(org.n52.shetland.ogc.om.features.FeatureCollection) GetFeatureOfInterestResponseType(net.opengis.sos.x20.GetFeatureOfInterestResponseType) GetFeatureOfInterestResponseDocument(net.opengis.sos.x20.GetFeatureOfInterestResponseDocument) AbstractFeature(org.n52.shetland.ogc.gml.AbstractFeature) SamplingFeature(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)

Example 19 with FeatureCollection

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);
    }
}
Also used : OmObservation(org.n52.shetland.ogc.om.OmObservation) CodeWithAuthority(org.n52.shetland.ogc.gml.CodeWithAuthority)

Example 20 with FeatureCollection

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;
}
Also used : FeatureCollection(org.n52.shetland.ogc.om.features.FeatureCollection) XmlObject(org.apache.xmlbeans.XmlObject) FeaturePropertyType(net.opengis.gml.x32.FeaturePropertyType)

Aggregations

FeatureCollection (org.n52.shetland.ogc.om.features.FeatureCollection)14 DateTime (org.joda.time.DateTime)8 AbstractFeature (org.n52.shetland.ogc.gml.AbstractFeature)8 XmlObject (org.apache.xmlbeans.XmlObject)7 OmObservation (org.n52.shetland.ogc.om.OmObservation)6 EncodingException (org.n52.svalbard.encode.exception.EncodingException)5 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)4 TimePeriod (org.n52.shetland.ogc.gml.time.TimePeriod)4 SamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)4 OwsExceptionReport (org.n52.shetland.ogc.ows.exception.OwsExceptionReport)4 EReportingHeader (org.n52.shetland.aqd.EReportingHeader)3 CodeWithAuthority (org.n52.shetland.ogc.gml.CodeWithAuthority)3 Time (org.n52.shetland.ogc.gml.time.Time)3 AbstractSamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.AbstractSamplingFeature)3 UnsupportedEncoderInputException (org.n52.svalbard.encode.exception.UnsupportedEncoderInputException)3 FeaturePropertyType (net.opengis.gml.x32.FeaturePropertyType)2 Test (org.junit.Test)2 LineString (org.locationtech.jts.geom.LineString)2 ObservationStream (org.n52.shetland.ogc.om.ObservationStream)2 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1