use of org.geotoolkit.gml.xml.v311.MultiLineStringType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method testGMLToMultiLineStringType.
@Test
public void testGMLToMultiLineStringType() throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
String multiLineStringGML = Wfs10JTStoGML200Converter.convertGeometryToGML(getGeometryFromWkt(MULTILINESTRING));
MultiLineStringType multiLineStringType = (MultiLineStringType) Wfs10JTStoGML200Converter.convertGMLToGeometryType(multiLineStringGML, Wfs10Constants.MULTI_LINESTRING);
List<JAXBElement<? extends GeometryAssociationType>> jaxbElements = multiLineStringType.getGeometryMember();
assertThat(jaxbElements.isEmpty(), is(Boolean.FALSE));
assertThat(jaxbElements.size() == 2, is(Boolean.TRUE));
String coordinates1 = extractLineStringMemberCoordinates(jaxbElements.get(0));
assertThat(coordinates1.isEmpty(), is(Boolean.FALSE));
assertThat(MULTILINESTRING_COORD1.equals(coordinates1), is(Boolean.TRUE));
String coordinates2 = extractLineStringMemberCoordinates(jaxbElements.get(1));
assertThat(coordinates2.isEmpty(), is(Boolean.FALSE));
assertThat(MULTILINESTRING_COORD2.equals(coordinates2), is(Boolean.TRUE));
}
use of org.geotoolkit.gml.xml.v311.MultiLineStringType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method testMultiLineStringTypeToJAXB.
@Test
public void testMultiLineStringTypeToJAXB() throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
String multiLineString = Wfs10JTStoGML200Converter.convertGeometryToGML(getGeometryFromWkt(MULTILINESTRING));
MultiLineStringType multiLineStringType = (MultiLineStringType) Wfs10JTStoGML200Converter.convertGMLToGeometryType(multiLineString, Wfs10Constants.MULTI_LINESTRING);
JAXBElement<MultiLineStringType> multiLineStringTypeJAXBElement = (JAXBElement<MultiLineStringType>) Wfs10JTStoGML200Converter.convertGeometryTypeToJAXB(multiLineStringType);
JAXB.marshal(multiLineStringTypeJAXBElement, writer);
String xml = writer.toString();
Diff diff = XMLUnit.compareXML(xml, MULTILINESTRING_GML);
assertTrue(XMLUNIT_SIMILAR, diff.similar());
assertThat(diff.similar(), is(Boolean.TRUE));
assertThat(diff.identical(), is(Boolean.FALSE));
}
use of org.geotoolkit.gml.xml.v311.MultiLineStringType in project geo-platform by geosdi.
the class GMLMultiLineStringParserTest method b_multiLineStringJTSParserTest.
@Test
public void b_multiLineStringJTSParserTest() throws Exception {
MultiLineStringType multiLineStringType = GPJAXBContextBuilder.newInstance().unmarshal(file1, MultiLineStringType.class);
logger.info("##########################MULTI_LINE_STRING_JTS : {}\n", multiLineStringParser.parseGeometry(multiLineStringType));
}
use of org.geotoolkit.gml.xml.v311.MultiLineStringType in project geo-platform by geosdi.
the class GMLMultiLineStringGeoJsonParserTest method a_multiLineStringGeoJsonParserTest.
@Test
public void a_multiLineStringGeoJsonParserTest() throws Exception {
MultiLineStringType multiLineStringType = jaxbContextBuilder.unmarshal(new File(dirFiles.concat("MultiLineString.xml")), MultiLineStringType.class);
logger.info("##########################MULTI_LINE_STRING_GEO_JSON : {}\n", mapper.writeValueAsString(multiLineStringParser.parseGeometryAsGeoJson(multiLineStringType)));
}
Aggregations