use of net.opengis.gml.v_3_2_1.LinearRingType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method testGMLToPolygonType.
@Test
public void testGMLToPolygonType() throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
Polygon polygon = (Polygon) getGeometryFromWkt(POLYGON);
assertThat(polygon == null, is(Boolean.FALSE));
String polygonGML = Wfs10JTStoGML200Converter.convertGeometryToGML(polygon);
PolygonType polygonType = (PolygonType) Wfs10JTStoGML200Converter.convertGMLToGeometryType(polygonGML, Wfs10Constants.POLYGON);
assertThat(null != polygonType, is(Boolean.TRUE));
assertThat(polygonType.isSetInnerBoundaryIs(), is(Boolean.FALSE));
assertThat(polygonType.isSetOuterBoundaryIs(), is(Boolean.TRUE));
LinearRingMemberType linearRingMemberType = polygonType.getOuterBoundaryIs();
JAXBElement<? extends AbstractGeometryType> geometry = linearRingMemberType.getGeometry();
LinearRingType linearRingType = (LinearRingType) geometry.getValue();
String coordinates = linearRingType.getCoordinates().getValue().replaceAll("\n", "").trim();
assertThat(POLYGON_COORDS.equals(coordinates), is(Boolean.TRUE));
}
Aggregations