use of ogc.schema.opengis.gml.v_2_1_2.PolygonMemberType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method testGMLToMultiPolygonType.
@Test
public void testGMLToMultiPolygonType() throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
String multiPolygonGML = Wfs10JTStoGML200Converter.convertGeometryToGML(getGeometryFromWkt(MULTIPOLYGON));
MultiPolygonType multiPolygonType = (MultiPolygonType) Wfs10JTStoGML200Converter.convertGMLToGeometryType(multiPolygonGML, Wfs10Constants.MULTI_POLYGON);
multiPolygonType.getJAXBElementName();
List<JAXBElement<? extends GeometryAssociationType>> geometryMembers = multiPolygonType.getGeometryMember();
assertThat(geometryMembers.size() == 2, is(Boolean.TRUE));
PolygonMemberType polygonMemberType1 = (PolygonMemberType) geometryMembers.get(0).getValue();
String coords1 = extractPolygonMemberCoordinates(polygonMemberType1);
assertThat(MULTIPOLYGON_COORDS1.equals(coords1), is(Boolean.TRUE));
PolygonMemberType polygonMemberType2 = (PolygonMemberType) geometryMembers.get(0).getValue();
String coords2 = extractPolygonMemberCoordinates(polygonMemberType2);
assertThat(MULTIPOLYGON_COORDS2.equals(coords2), is(Boolean.TRUE));
}
use of ogc.schema.opengis.gml.v_2_1_2.PolygonMemberType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method extractPolygonMemberCoordinates.
private String extractPolygonMemberCoordinates(PolygonMemberType polygonMemberType1) throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
JAXBElement<? extends AbstractGeometryType> polygonGeometry1 = polygonMemberType1.getGeometry();
assertThat(Wfs10Constants.POLYGON.getLocalPart().equals(polygonGeometry1.getName().getLocalPart()), is(Boolean.TRUE));
PolygonType polygonType1 = (PolygonType) polygonGeometry1.getValue();
LinearRingMemberType linearRingMemberType1 = polygonType1.getOuterBoundaryIs();
JAXBElement<? extends AbstractGeometryType> linearRingGeometry1 = linearRingMemberType1.getGeometry();
LinearRingType linearRingType1 = (LinearRingType) linearRingGeometry1.getValue();
return linearRingType1.getCoordinates().getValue().replaceAll("\n", "").trim();
}
Aggregations