Search in sources :

Example 41 with Placemark

use of de.micromata.opengis.kml.v_2_2_0.Placemark in project ddf by codice.

the class KmlModelToJtsPointConverterTest method setupClass.

@BeforeClass
public static void setupClass() {
    InputStream stream = KmlModelToJtsPointConverterTest.class.getResourceAsStream("/kmlModel.kml");
    Kml kml = Kml.unmarshal(stream);
    testKmlModel = ((Model) ((Placemark) kml.getFeature()).getGeometry());
}
Also used : InputStream(java.io.InputStream) Model(de.micromata.opengis.kml.v_2_2_0.Model) Kml(de.micromata.opengis.kml.v_2_2_0.Kml) BeforeClass(org.junit.BeforeClass)

Example 42 with Placemark

use of de.micromata.opengis.kml.v_2_2_0.Placemark in project ddf by codice.

the class KmlPlacemarkToJtsGeometryConverterTest method setupClass.

@BeforeClass
public static void setupClass() {
    InputStream stream = KmlPlacemarkToJtsGeometryConverterTest.class.getResourceAsStream("/kmlPoint.kml");
    Kml kml = Kml.unmarshal(stream);
    testKmlPlacemark = (Placemark) kml.getFeature();
}
Also used : InputStream(java.io.InputStream) Kml(de.micromata.opengis.kml.v_2_2_0.Kml) BeforeClass(org.junit.BeforeClass)

Example 43 with Placemark

use of de.micromata.opengis.kml.v_2_2_0.Placemark in project ddf by codice.

the class KmlToJtsCoordinateConverterTest method setupClass.

@BeforeClass
public static void setupClass() {
    InputStream stream = KmlToJtsCoordinateConverterTest.class.getResourceAsStream("/kmlLinearRing.kml");
    Kml kml = Kml.unmarshal(stream);
    LinearRing kmlLinearRing = ((LinearRing) ((Placemark) kml.getFeature()).getGeometry());
    testKmlCoordinates = kmlLinearRing.getCoordinates();
}
Also used : Placemark(de.micromata.opengis.kml.v_2_2_0.Placemark) InputStream(java.io.InputStream) Kml(de.micromata.opengis.kml.v_2_2_0.Kml) LinearRing(de.micromata.opengis.kml.v_2_2_0.LinearRing) BeforeClass(org.junit.BeforeClass)

Example 44 with Placemark

use of de.micromata.opengis.kml.v_2_2_0.Placemark in project ddf by codice.

the class KmlToJtsLineStringConverterTest method setupClass.

@BeforeClass
public static void setupClass() {
    InputStream stream = KmlToJtsLineStringConverterTest.class.getResourceAsStream("/kmlLineString.kml");
    Kml kml = Kml.unmarshal(stream);
    testKmlLineString = ((LineString) ((Placemark) kml.getFeature()).getGeometry());
}
Also used : LineString(de.micromata.opengis.kml.v_2_2_0.LineString) InputStream(java.io.InputStream) Kml(de.micromata.opengis.kml.v_2_2_0.Kml) BeforeClass(org.junit.BeforeClass)

Example 45 with Placemark

use of de.micromata.opengis.kml.v_2_2_0.Placemark in project ddf by codice.

the class KmlTransformationsTest method encloseDoc.

@Test
public void encloseDoc() {
    final Placemark placemark = new Placemark();
    final Style style = new Style();
    final String docId = "1";
    final String docName = "myDocName";
    final Document document = KmlTransformations.encloseDoc(placemark, style, docId, docName);
    assertThat(document.getId(), is(docId));
    assertThat(document.getName(), is(docName));
    assertThat(document.getStyleSelector(), hasSize(1));
    assertThat(document.getFeature(), hasSize(1));
}
Also used : Placemark(de.micromata.opengis.kml.v_2_2_0.Placemark) Style(de.micromata.opengis.kml.v_2_2_0.Style) Document(de.micromata.opengis.kml.v_2_2_0.Document) Test(org.junit.Test)

Aggregations

Placemark (de.micromata.opengis.kml.v_2_2_0.Placemark)35 Test (org.junit.Test)29 Kml (de.micromata.opengis.kml.v_2_2_0.Kml)23 InputStream (java.io.InputStream)20 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)19 Point (de.micromata.opengis.kml.v_2_2_0.Point)19 TimeSpan (de.micromata.opengis.kml.v_2_2_0.TimeSpan)16 MultiGeometry (de.micromata.opengis.kml.v_2_2_0.MultiGeometry)15 LineString (de.micromata.opengis.kml.v_2_2_0.LineString)12 Polygon (de.micromata.opengis.kml.v_2_2_0.Polygon)10 BeforeClass (org.junit.BeforeClass)8 LinearRing (de.micromata.opengis.kml.v_2_2_0.LinearRing)5 Document (de.micromata.opengis.kml.v_2_2_0.Document)4 Feature (de.micromata.opengis.kml.v_2_2_0.Feature)4 Style (de.micromata.opengis.kml.v_2_2_0.Style)4 ByteArrayInputStream (java.io.ByteArrayInputStream)4 IOException (java.io.IOException)4 ProfilePlacemark (se.trixon.mapollage.profile.ProfilePlacemark)4 BalloonStyle (de.micromata.opengis.kml.v_2_2_0.BalloonStyle)3 IconStyle (de.micromata.opengis.kml.v_2_2_0.IconStyle)3