use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlPhotoOverlayToJtsPointConverterTest method setupClass.
@BeforeClass
public static void setupClass() {
InputStream stream = KmlPhotoOverlayToJtsPointConverterTest.class.getResourceAsStream("/kmlPhotoOverlay.kml");
Kml kml = Kml.unmarshal(stream);
testKmlPhotoOverlay = ((PhotoOverlay) kml.getFeature());
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsGeometryConverterTest method testConvertPointGeometry.
@Test
public void testConvertPointGeometry() {
InputStream stream = KmlToJtsGeometryConverterTest.class.getResourceAsStream("/kmlPoint.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
Point kmlPoint = ((Point) ((Placemark) kml.getFeature()).getGeometry());
assertThat(kmlPoint, notNullValue());
org.locationtech.jts.geom.Geometry jtsGeometryPoint = KmlToJtsGeometryConverter.from(kmlPoint);
assertThat(jtsGeometryPoint, instanceOf(org.locationtech.jts.geom.Point.class));
assertSpecificGeometry(kmlPoint, jtsGeometryPoint);
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsGeometryConverterTest method testConvertPolygonGeometry.
@Test
public void testConvertPolygonGeometry() {
InputStream stream = KmlToJtsGeometryConverterTest.class.getResourceAsStream("/kmlPolygon.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
Polygon kmlPolygon = ((Polygon) ((Placemark) kml.getFeature()).getGeometry());
assertThat(kmlPolygon, notNullValue());
org.locationtech.jts.geom.Geometry jtsGeometryPolygon = KmlToJtsGeometryConverter.from(kmlPolygon);
assertThat(jtsGeometryPolygon, instanceOf(org.locationtech.jts.geom.Polygon.class));
assertSpecificGeometry(kmlPolygon, jtsGeometryPolygon);
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsGeometryConverterTest method testConvertMultiGeometry.
@Test
public void testConvertMultiGeometry() {
InputStream stream = KmlToJtsGeometryConverterTest.class.getResourceAsStream("/kmlMultiGeometry.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
MultiGeometry multiGeometry = ((MultiGeometry) ((Placemark) kml.getFeature()).getGeometry());
assertThat(multiGeometry, notNullValue());
org.locationtech.jts.geom.Geometry jtsGeometryCollectionGeometry = KmlToJtsGeometryConverter.from(multiGeometry);
assertThat(jtsGeometryCollectionGeometry, instanceOf(GeometryCollection.class));
assertSpecificGeometry(multiGeometry, jtsGeometryCollectionGeometry);
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsGeometryConverterTest method testConvertLinearRingGeometry.
@Test
public void testConvertLinearRingGeometry() {
InputStream stream = KmlToJtsGeometryConverterTest.class.getResourceAsStream("/kmlLinearRing.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
LinearRing kmlLinearRing = ((LinearRing) ((Placemark) kml.getFeature()).getGeometry());
assertThat(kmlLinearRing, notNullValue());
org.locationtech.jts.geom.Geometry jtsGeometryLinearRing = KmlToJtsGeometryConverter.from(kmlLinearRing);
assertThat(jtsGeometryLinearRing, instanceOf(org.locationtech.jts.geom.LinearRing.class));
assertSpecificGeometry(kmlLinearRing, jtsGeometryLinearRing);
}
Aggregations