use of de.micromata.opengis.kml.v_2_2_0.LineString in project ddf by codice.
the class KmlToJtsLineStringConverterTest method testKmlLineStringWithNoCoordinatesReturnsNull.
@Test
public void testKmlLineStringWithNoCoordinatesReturnsNull() {
org.locationtech.jts.geom.LineString jtsLineString = KmlToJtsLineStringConverter.from(new LineString());
assertThat(jtsLineString, nullValue());
}
use of de.micromata.opengis.kml.v_2_2_0.LineString in project ddf by codice.
the class MetacardToKmlTest method getKmlGeoFromJtsGeoLineString.
@Test
public void getKmlGeoFromJtsGeoLineString() throws CatalogTransformerException {
final org.locationtech.jts.geom.Geometry jtsGeoFromWkt = MetacardToKml.getJtsGeoFromWkt("LINESTRING (-138.957229 48.595168,-121.188711 54.41378,-107.922043 50.230924)");
final Geometry kmlGeo = MetacardToKml.getKmlGeoFromJtsGeo(jtsGeoFromWkt);
assertTrue(kmlGeo instanceof LineString);
final LineString kmlLineString = (LineString) kmlGeo;
assertThat(kmlLineString.getCoordinates(), hasSize(3));
assertThat(kmlLineString.getCoordinates().get(0).getLongitude(), is(-138.957229));
assertThat(kmlLineString.getCoordinates().get(0).getLatitude(), is(48.595168));
}
use of de.micromata.opengis.kml.v_2_2_0.LineString in project ddf by codice.
the class MetacardToKml method createLineStringGeo.
private static Geometry createLineStringGeo(LineString jtsLS) {
de.micromata.opengis.kml.v_2_2_0.LineString kmlLS = KmlFactory.createLineString();
List<Coordinate> kmlCoords = kmlLS.createAndSetCoordinates();
for (org.locationtech.jts.geom.Coordinate coord : jtsLS.getCoordinates()) {
kmlCoords.add(new Coordinate(coord.x, coord.y));
}
return kmlLS;
}
Aggregations