Search in sources :

Example 1 with MultiPointDomainDocument

use of net.opengis.gml.x32.MultiPointDomainDocument in project arctic-sea by 52North.

the class AbstractMultiPointCoverageTypeEncoder method encodeMultiPointDomain.

private void encodeMultiPointDomain(DiscreteCoverageType dct, PointValueLists pointValues) throws EncodingException {
    MultiPointDomainDocument mpdd = MultiPointDomainDocument.Factory.newInstance();
    DomainSetType mpdst = mpdd.addNewMultiPointDomain();
    GeometryFactory factory = pointValues.getPoints().get(0).getFactory();
    MultiPoint multiPoint = factory.createMultiPoint(pointValues.getPoints().toArray(new Point[0]));
    EncodingContext ec = EncodingContext.of(XmlBeansEncodingFlags.GMLID, JavaHelper.generateID(multiPoint.toString())).with(XmlBeansEncodingFlags.PROPERTY_TYPE, true);
    XmlObject encodedGeometry = encodeGML(multiPoint, ec);
    mpdst.addNewAbstractGeometry().set(encodedGeometry);
    substitute(mpdst.getAbstractGeometry(), encodedGeometry);
    dct.setDomainSet(mpdst);
}
Also used : MultiPoint(org.locationtech.jts.geom.MultiPoint) MultiPointDomainDocument(net.opengis.gml.x32.MultiPointDomainDocument) GeometryFactory(org.locationtech.jts.geom.GeometryFactory) XmlObject(org.apache.xmlbeans.XmlObject) Point(org.locationtech.jts.geom.Point) MultiPoint(org.locationtech.jts.geom.MultiPoint) DomainSetType(net.opengis.gml.x32.DomainSetType)

Aggregations

DomainSetType (net.opengis.gml.x32.DomainSetType)1 MultiPointDomainDocument (net.opengis.gml.x32.MultiPointDomainDocument)1 XmlObject (org.apache.xmlbeans.XmlObject)1 GeometryFactory (org.locationtech.jts.geom.GeometryFactory)1 MultiPoint (org.locationtech.jts.geom.MultiPoint)1 Point (org.locationtech.jts.geom.Point)1