use of ogc.schema.opengis.gml.v_2_1_2.GeometryAssociationType 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.GeometryAssociationType 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 ogc.schema.opengis.gml.v_2_1_2.GeometryAssociationType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method extractPointMemberTypeCoordinates.
private String extractPointMemberTypeCoordinates(JAXBElement<? extends GeometryAssociationType> jaxbElement1) throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
assertThat(Wfs10Constants.POINT_MEMBER.getLocalPart().equals(jaxbElement1.getName().getLocalPart()), is(Boolean.TRUE));
PointMemberType pointMemberType1 = (PointMemberType) jaxbElement1.getValue();
JAXBElement<? extends AbstractGeometryType> geometry1 = pointMemberType1.getGeometry();
assertThat(Wfs10Constants.POINT.getLocalPart().equals(geometry1.getName().getLocalPart()), is(Boolean.TRUE));
return ((PointType) geometry1.getValue()).getCoordinates().getValue().replaceAll("\n", "").trim();
}
use of ogc.schema.opengis.gml.v_2_1_2.GeometryAssociationType in project ddf by codice.
the class TestWfs10JTStoGML200Converter method testGMLToGeometryCollectionType.
@Test
public void testGMLToGeometryCollectionType() throws JAXBException, SAXException, IOException, ParseException, NullPointerException {
String geometryCollectionGML = Wfs10JTStoGML200Converter.convertGeometryToGML(getGeometryFromWkt(GEOMETRYCOLLECTION));
GeometryCollectionType geometryCollectionType = (GeometryCollectionType) Wfs10JTStoGML200Converter.convertGMLToGeometryType(geometryCollectionGML, Wfs10Constants.GEOMETRY_COLLECTION);
assertFalse(geometryCollectionType == null);
List<JAXBElement<? extends GeometryAssociationType>> geometryMembers = geometryCollectionType.getGeometryMember();
assertThat(CollectionUtils.isEmpty(geometryMembers), is(Boolean.FALSE));
assertThat(geometryMembers.size() == 2, is(Boolean.TRUE));
GeometryAssociationType geometryAssociationType = geometryMembers.get(0).getValue();
JAXBElement<? extends AbstractGeometryType> jaxbElement = geometryAssociationType.getGeometry();
assertThat(Wfs10Constants.POINT.getLocalPart().equals(jaxbElement.getName().getLocalPart()), is(Boolean.TRUE));
PointType pointType = (PointType) jaxbElement.getValue();
assertThat(pointType == null, is(Boolean.FALSE));
assertThat(GEOMETRYCOLLECTION_POINT_COORD.equals(pointType.getCoordinates().getValue().trim()), is(Boolean.TRUE));
GeometryAssociationType geometryAssociationType2 = geometryMembers.get(1).getValue();
JAXBElement<? extends AbstractGeometryType> jaxbElement2 = geometryAssociationType2.getGeometry();
assertThat(Wfs10Constants.LINESTRING.getLocalPart().equals(jaxbElement2.getName().getLocalPart()), is(Boolean.TRUE));
LineStringType lineStringType = (LineStringType) jaxbElement2.getValue();
assertThat(lineStringType == null, is(Boolean.FALSE));
assertThat(GEOMETRYCOLLECTION_LINESTRING_COORD.equals(lineStringType.getCoordinates().getValue().trim()), is(Boolean.TRUE));
}
use of ogc.schema.opengis.gml.v_2_1_2.GeometryAssociationType 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));
}
Aggregations