Search in sources :

Example 6 with MultiPoint

use of com.vividsolutions.jts.geom.MultiPoint in project ddf by codice.

the class Wfs20JTStoGML321Converter method convertToMultiPointType.

public static MultiPointType convertToMultiPointType(MultiPoint multiPoint, String srsName) {
    MultiPointType multiPointType = GML320_OBJECT_FACTORY.createMultiPointType();
    for (int i = 0; i < multiPoint.getNumGeometries(); i++) {
        Point point = (Point) multiPoint.getGeometryN(i);
        PointPropertyType pointPropertyType = GML320_OBJECT_FACTORY.createPointPropertyType();
        pointPropertyType.setPoint(convertToPointType(point, srsName));
        multiPointType.getPointMember().add(pointPropertyType);
    }
    multiPointType.setSrsName(srsName);
    return multiPointType;
}
Also used : Point(com.vividsolutions.jts.geom.Point) MultiPoint(com.vividsolutions.jts.geom.MultiPoint) PointPropertyType(net.opengis.gml.v_3_2_1.PointPropertyType) MultiPointType(net.opengis.gml.v_3_2_1.MultiPointType) Point(com.vividsolutions.jts.geom.Point) MultiPoint(com.vividsolutions.jts.geom.MultiPoint)

Example 7 with MultiPoint

use of com.vividsolutions.jts.geom.MultiPoint in project ddf by codice.

the class TestWfs10JTStoGML200Converter method testGeometryToMultiPointGML.

@Test
public void testGeometryToMultiPointGML() throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
    MultiPoint multiPoint = (MultiPoint) getGeometryFromWkt(MULTIPOINT);
    assertThat(multiPoint == null, is(Boolean.FALSE));
    String multiPointGML = Wfs10JTStoGML200Converter.convertGeometryToGML(multiPoint).replaceAll("\n", "");
    assertThat(StringUtils.isEmpty(multiPointGML), is(Boolean.FALSE));
    Diff diff = XMLUnit.compareXML(multiPointGML, MULTIPOINT_GML);
    assertTrue(XMLUNIT_IDENTICAL, diff.identical());
    assertTrue(XMLUNIT_SIMILAR, diff.similar());
}
Also used : MultiPoint(com.vividsolutions.jts.geom.MultiPoint) Diff(org.custommonkey.xmlunit.Diff) LineString(com.vividsolutions.jts.geom.LineString) MultiLineString(com.vividsolutions.jts.geom.MultiLineString) Test(org.junit.Test)

Aggregations

MultiPoint (com.vividsolutions.jts.geom.MultiPoint)7 Point (com.vividsolutions.jts.geom.Point)4 LineString (com.vividsolutions.jts.geom.LineString)3 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)3 GeometryCollection (com.vividsolutions.jts.geom.GeometryCollection)2 MultiPolygon (com.vividsolutions.jts.geom.MultiPolygon)2 Polygon (com.vividsolutions.jts.geom.Polygon)2 MultiPointType (net.opengis.gml.v_3_2_1.MultiPointType)2 Test (org.junit.Test)2 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 Geometry (com.vividsolutions.jts.geom.Geometry)1 ParseException (com.vividsolutions.jts.io.ParseException)1 GeometryPropertyType (net.opengis.gml.v_3_2_1.GeometryPropertyType)1 LineStringType (net.opengis.gml.v_3_2_1.LineStringType)1 MultiCurveType (net.opengis.gml.v_3_2_1.MultiCurveType)1 MultiGeometryType (net.opengis.gml.v_3_2_1.MultiGeometryType)1 MultiSurfaceType (net.opengis.gml.v_3_2_1.MultiSurfaceType)1 PointPropertyType (net.opengis.gml.v_3_2_1.PointPropertyType)1 PointType (net.opengis.gml.v_3_2_1.PointType)1