use of de.micromata.opengis.kml.v_2_2_0.Coordinate in project ddf by codice.
the class KmlLatLonBoxToJtsGeometryConverterTest method createKmlBoundingBoxCoordinates.
private static List<Coordinate> createKmlBoundingBoxCoordinates(double minX, double maxX, double minY, double maxY) {
List<Coordinate> coordinates = new ArrayList<>();
// This is the order that WKT wants the polygon
// Starting Upper Right, moving clockwise
coordinates.add(new Coordinate(maxX, maxY));
coordinates.add(new Coordinate(maxX, minY));
coordinates.add(new Coordinate(minX, minY));
coordinates.add(new Coordinate(minX, maxY));
coordinates.add(new Coordinate(maxX, maxY));
return coordinates;
}
use of de.micromata.opengis.kml.v_2_2_0.Coordinate in project ddf by codice.
the class KmlToJtsCoordinateConverterTest method assertJtsCoordinatesFromKmlCoordinates.
static void assertJtsCoordinatesFromKmlCoordinates(List<Coordinate> kmlCoordinates, org.locationtech.jts.geom.Coordinate[] jtsCoordinates) {
assertThat(jtsCoordinates.length, is(equalTo(kmlCoordinates.size())));
for (Coordinate kmlCoordinate : kmlCoordinates) {
org.locationtech.jts.geom.Coordinate jtsCoordinate = new org.locationtech.jts.geom.Coordinate(kmlCoordinate.getLongitude(), kmlCoordinate.getLatitude(), kmlCoordinate.getAltitude());
assertThat(jtsCoordinates, hasItemInArray((jtsCoordinate)));
}
}
use of de.micromata.opengis.kml.v_2_2_0.Coordinate in project ddf by codice.
the class KmlModelToJtsPointConverter method from.
public static Point from(Model kmlModel) {
if (kmlModel == null || kmlModel.getLocation() == null) {
return null;
}
Location kmlLocation = kmlModel.getLocation();
Coordinate jtsCoordinate = new Coordinate(kmlLocation.getLongitude(), kmlLocation.getLatitude(), kmlLocation.getAltitude());
GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
return geometryFactory.createPoint(jtsCoordinate);
}
use of de.micromata.opengis.kml.v_2_2_0.Coordinate 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