Search in sources :

Example 21 with FeatureCollection

use of org.n52.shetland.ogc.om.features.FeatureCollection in project arctic-sea by 52North.

the class SamplingEncoderv100 method createFeatureCollection.

private XmlObject createFeatureCollection(FeatureCollection sosFeatureCollection) throws EncodingException {
    SamplingFeatureCollectionDocument xbSampFeatCollDoc = SamplingFeatureCollectionDocument.Factory.newInstance(getXmlOptions());
    SamplingFeatureCollectionType xbSampFeatColl = xbSampFeatCollDoc.addNewSamplingFeatureCollection();
    xbSampFeatColl.setId("sfc_" + Long.toString(new DateTime().getMillis()));
    for (AbstractFeature sosAbstractFeature : sosFeatureCollection.getMembers().values()) {
        SamplingFeaturePropertyType xbFeatMember = xbSampFeatColl.addNewMember();
        xbFeatMember.set(createFeature(sosAbstractFeature));
    }
    return xbSampFeatCollDoc;
}
Also used : SamplingFeatureCollectionType(net.opengis.sampling.x10.SamplingFeatureCollectionType) SamplingFeaturePropertyType(net.opengis.sampling.x10.SamplingFeaturePropertyType) SamplingFeatureCollectionDocument(net.opengis.sampling.x10.SamplingFeatureCollectionDocument) AbstractFeature(org.n52.shetland.ogc.gml.AbstractFeature) DateTime(org.joda.time.DateTime)

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