use of net.opengis.gml.x32.MultiPointType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method testGMLToMultiPointType.
@Test
public void testGMLToMultiPointType() throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
String multiPointGML = Wfs10JTStoGML200Converter.convertGeometryToGML(getGeometryFromWkt(MULTIPOINT));
MultiPointType multiPointType = (MultiPointType) Wfs10JTStoGML200Converter.convertGMLToGeometryType(multiPointGML, Wfs10Constants.MULTI_POINT);
List<JAXBElement<? extends GeometryAssociationType>> geoMembers = multiPointType.getGeometryMember();
assertThat(geoMembers.isEmpty(), is(Boolean.FALSE));
assertThat(Wfs10Constants.MULTI_POINT.getLocalPart().equals(multiPointType.getJAXBElementName().getLocalPart()), is(Boolean.TRUE));
assertThat(geoMembers.size() == 4, is(Boolean.TRUE));
String coords1 = extractPointMemberTypeCoordinates(geoMembers.get(0));
assertThat(MULTIPOINT_COORDS1.equals(coords1), is(Boolean.TRUE));
String coords2 = extractPointMemberTypeCoordinates(geoMembers.get(1));
assertThat(MULTIPOINT_COORDS2.equals(coords2), is(Boolean.TRUE));
String coords3 = extractPointMemberTypeCoordinates(geoMembers.get(2));
assertThat(MULTIPOINT_COORDS3.equals(coords3), is(Boolean.TRUE));
String coords4 = extractPointMemberTypeCoordinates(geoMembers.get(3));
assertThat(MULTIPOINT_COORDS4.equals(coords4), is(Boolean.TRUE));
}
use of net.opengis.gml.x32.MultiPointType in project arctic-sea by 52North.
the class GmlEncoderv321 method createMultiPointFromJtsGeometry.
private void createMultiPointFromJtsGeometry(MultiPoint geom, MultiPointType xbMultiPoint, String id) throws EncodingException {
for (int i = 0; i < geom.getNumGeometries(); i++) {
Geometry geometry = geom.getGeometryN(i);
if (geometry instanceof Point) {
PointType pt = xbMultiPoint.addNewPointMember().addNewPoint();
pt.setId(id + "_" + i);
createPointFromJtsGeometry((Point) geometry, pt);
}
}
}
Aggregations