use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class MetacardToKmlTest method addJtsGeoPointsToKmlGeo.
@Test
public void addJtsGeoPointsToKmlGeo() {
final LineString kmlLineString = new LineString();
kmlLineString.setCoordinates(singletonList(new Coordinate(80.0, 170.0)));
doReturn(new org.locationtech.jts.geom.Coordinate()).when(jtsLineString).getCoordinate();
final Geometry newKmlGeometry = MetacardToKml.addJtsGeoPointsToKmlGeo(jtsLineString, kmlLineString);
assertTrue(newKmlGeometry instanceof MultiGeometry);
final MultiGeometry multiGeometry = (MultiGeometry) newKmlGeometry;
assertThat("New KML Geometry should be MultiGeometry containing 2 Geometries", multiGeometry.getGeometry(), hasSize(2));
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlFolderToJtsGeometryConverterTest method setupClass.
@BeforeClass
public static void setupClass() {
InputStream stream = KmlFolderToJtsGeometryConverterTest.class.getResourceAsStream("/kmlFolder.kml");
Kml kml = Kml.unmarshal(stream);
testKmlFolder = ((Folder) kml.getFeature());
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsMultiGeometryConverterTest method setupClass.
@BeforeClass
public static void setupClass() {
InputStream stream = KmlToJtsMultiGeometryConverterTest.class.getResourceAsStream("/kmlMultiGeometry.kml");
Kml kml = Kml.unmarshal(stream);
testKmlMultiGeometry = ((MultiGeometry) ((Placemark) kml.getFeature()).getGeometry());
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsPolygonConverterTest method setupClass.
@BeforeClass
public static void setupClass() {
InputStream stream = KmlToJtsPolygonConverterTest.class.getResourceAsStream("/kmlPolygon.kml");
Kml kml = Kml.unmarshal(stream);
testKmlPolygon = ((Polygon) ((Placemark) kml.getFeature()).getGeometry());
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsPolygonConverterTest method getTestKmlPolygonWithHoles.
private Polygon getTestKmlPolygonWithHoles() {
InputStream stream = KmlToJtsPolygonConverterTest.class.getResourceAsStream("/kmlPolygonWithHoles.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
Polygon polygon = ((Polygon) ((Placemark) kml.getFeature()).getGeometry());
assertThat(polygon, notNullValue());
LinearRing linearRing = polygon.getOuterBoundaryIs().getLinearRing();
assertThat(linearRing, notNullValue());
List<LinearRing> holes = polygon.getInnerBoundaryIs().stream().map(Boundary::getLinearRing).collect(Collectors.toList());
assertThat(holes, not(empty()));
return polygon;
}
Aggregations