use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsPointConverterTest method setupClass.
@BeforeClass
public static void setupClass() {
InputStream stream = KmlToJtsPointConverterTest.class.getResourceAsStream("/kmlPoint.kml");
Kml kml = Kml.unmarshal(stream);
testKmlPoint = ((Point) ((Placemark) kml.getFeature()).getGeometry());
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToMetacardTest method testKmlWithTimeSpan.
@Test
public void testKmlWithTimeSpan() {
InputStream stream = KmlToJtsConverterTest.class.getResourceAsStream("/kmlWithTimeSpan.kml");
Kml kml = Kml.unmarshal(stream);
Metacard metacard = KmlToMetacard.from(new MetacardImpl(), kml);
assertThat(metacard, notNullValue());
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToMetacardTest method testConvertKmlMultiGeometryToMetacardWithBbox.
@Test
public void testConvertKmlMultiGeometryToMetacardWithBbox() {
InputStream stream = KmlToJtsConverterTest.class.getResourceAsStream("/kmlMultiGeometry.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
Metacard metacard = KmlToMetacard.from(new MetacardImpl(), kml);
assertThat(metacard, notNullValue());
MultiGeometry kmlMultiGeometry = ((MultiGeometry) ((Placemark) kml.getFeature()).getGeometry());
assertThat(kmlMultiGeometry, notNullValue());
Geometry jtsGeometryCollectionGeometry = KmlToJtsGeometryConverter.from(kmlMultiGeometry);
assertThat(jtsGeometryCollectionGeometry, notNullValue());
String wktBbox = jtsGeometryCollectionGeometry.getEnvelope().toText();
assertThat(metacard.getAttribute(Metacard.GEOGRAPHY).getValue().toString(), is(equalToIgnoringWhiteSpace(wktBbox)));
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToMetacardTest method testConvertBadKmlReturnsNullMetacard.
@Test
public void testConvertBadKmlReturnsNullMetacard() {
InputStream stream = KmlToJtsConverterTest.class.getResourceAsStream("/notKml.kml");
Kml kml = Kml.unmarshal(stream);
Metacard metacard = KmlToMetacard.from(new MetacardImpl(), kml);
assertThat(metacard, nullValue());
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToMetacardTest method testKmlWithNoGeometry.
@Test
public void testKmlWithNoGeometry() {
InputStream stream = KmlToJtsConverterTest.class.getResourceAsStream("/kmlWithNoGeometry.kml");
Kml kml = Kml.unmarshal(stream);
Metacard metacard = KmlToMetacard.from(new MetacardImpl(), kml);
assertThat(metacard, notNullValue());
}
Aggregations