use of de.micromata.opengis.kml.v_2_2_0.Placemark 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.Placemark 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;
}
use of de.micromata.opengis.kml.v_2_2_0.Placemark in project ddf by codice.
the class KmlToJtsGeometryConverterTest method testConvertModelGeometry.
@Test
public void testConvertModelGeometry() {
InputStream stream = KmlToJtsGeometryConverterTest.class.getResourceAsStream("/kmlModel.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
Model model = ((Model) ((Placemark) kml.getFeature()).getGeometry());
assertThat(model, notNullValue());
org.locationtech.jts.geom.Geometry jtsGeometryPointFromModel = KmlToJtsGeometryConverter.from(model);
assertThat(jtsGeometryPointFromModel, instanceOf(org.locationtech.jts.geom.Point.class));
assertSpecificGeometry(model, jtsGeometryPointFromModel);
}
use of de.micromata.opengis.kml.v_2_2_0.Placemark in project ddf by codice.
the class KmlToJtsGeometryConverterTest method testConvertLineStringGeometry.
@Test
public void testConvertLineStringGeometry() {
InputStream stream = KmlToJtsGeometryConverterTest.class.getResourceAsStream("/kmlLineString.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
LineString kmlLineString = ((LineString) ((Placemark) kml.getFeature()).getGeometry());
assertThat(kmlLineString, notNullValue());
org.locationtech.jts.geom.Geometry jtsGeometryLineString = KmlToJtsGeometryConverter.from(kmlLineString);
assertThat(jtsGeometryLineString, instanceOf(org.locationtech.jts.geom.LineString.class));
assertSpecificGeometry(kmlLineString, jtsGeometryLineString);
}
use of de.micromata.opengis.kml.v_2_2_0.Placemark in project ddf by codice.
the class KmlToJtsLinearRingConverterTest method setupClass.
@BeforeClass
public static void setupClass() {
InputStream stream = KmlToJtsLinearRingConverterTest.class.getResourceAsStream("/kmlLinearRing.kml");
Kml kml = Kml.unmarshal(stream);
testKmlLinearRing = ((LinearRing) ((Placemark) kml.getFeature()).getGeometry());
}
Aggregations