use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsConverterTest method testConvertGiantKml.
@Test
public void testConvertGiantKml() {
InputStream stream = KmlToJtsConverterTest.class.getResourceAsStream("/sampleKml.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
Geometry jtsGeometry = KmlToJtsConverter.from(kml);
assertThat(jtsGeometry, notNullValue());
assertThat(jtsGeometry.toString(), not(containsString("EMPTY")));
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsConverterTest method testConvertKml.
@Test
public void testConvertKml() {
InputStream stream = KmlToJtsConverterTest.class.getResourceAsStream("/kmlPoint.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
Geometry jtsGeometry = KmlToJtsConverter.from(kml);
KmlFeatureToJtsGeometryConverterTest.assertFeature(kml.getFeature(), jtsGeometry);
}
use of de.micromata.opengis.kml.v_2_2_0.Kml 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.Kml 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.Kml 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