use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlEndpointTest method testGetAvailableSourcesVisibleByDefault.
@Test
public void testGetAvailableSourcesVisibleByDefault() throws UnknownHostException, MalformedURLException, IllegalArgumentException, UriBuilderException, SourceUnavailableException {
when(mockUriInfo.getQueryParameters(false)).thenReturn(mockMap);
KmlEndpoint kmlEndpoint = new KmlEndpoint(mockBranding, mockFramework);
Kml response = kmlEndpoint.getAvailableSources(mockUriInfo);
assertThat(response, notNullValue());
assertThat(response.getFeature(), instanceOf(Folder.class));
Folder folder = (Folder) response.getFeature();
assertThat(folder.getFeature(), notNullValue());
assertThat(folder.getFeature().size(), is(2));
assertThat(folder.getFeature().get(0), instanceOf(NetworkLink.class));
assertThat(folder.getFeature().get(1), instanceOf(NetworkLink.class));
NetworkLink nl1 = (NetworkLink) folder.getFeature().get(0);
assertThat(nl1.getName(), anyOf(is(REMOTE_SITE_NAME), is(LOCAL_SITE_NAME)));
assertThat(nl1.isVisibility(), is(false));
NetworkLink nl2 = (NetworkLink) folder.getFeature().get(1);
assertThat(nl2.getName(), anyOf(is(REMOTE_SITE_NAME), is(LOCAL_SITE_NAME)));
assertThat(nl2.isVisibility(), is(false));
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlLatLonBoxToJtsGeometryConverterTest method setupClass.
@BeforeClass
public static void setupClass() {
InputStream stream = KmlLatLonBoxToJtsGeometryConverterTest.class.getResourceAsStream("/kmlGroundOverlay.kml");
Kml kml = Kml.unmarshal(stream);
GroundOverlay groundOverlay = ((GroundOverlay) kml.getFeature());
testKmlLatLonBox = groundOverlay.getLatLonBox();
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlPhotoOverlayToJtsPointConverterTest method setupClass.
@BeforeClass
public static void setupClass() {
InputStream stream = KmlPhotoOverlayToJtsPointConverterTest.class.getResourceAsStream("/kmlPhotoOverlay.kml");
Kml kml = Kml.unmarshal(stream);
testKmlPhotoOverlay = ((PhotoOverlay) kml.getFeature());
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsGeometryConverterTest method testConvertPointGeometry.
@Test
public void testConvertPointGeometry() {
InputStream stream = KmlToJtsGeometryConverterTest.class.getResourceAsStream("/kmlPoint.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
Point kmlPoint = ((Point) ((Placemark) kml.getFeature()).getGeometry());
assertThat(kmlPoint, notNullValue());
org.locationtech.jts.geom.Geometry jtsGeometryPoint = KmlToJtsGeometryConverter.from(kmlPoint);
assertThat(jtsGeometryPoint, instanceOf(org.locationtech.jts.geom.Point.class));
assertSpecificGeometry(kmlPoint, jtsGeometryPoint);
}
use of de.micromata.opengis.kml.v_2_2_0.Kml in project ddf by codice.
the class KmlToJtsGeometryConverterTest method testConvertPolygonGeometry.
@Test
public void testConvertPolygonGeometry() {
InputStream stream = KmlToJtsGeometryConverterTest.class.getResourceAsStream("/kmlPolygon.kml");
Kml kml = Kml.unmarshal(stream);
assertThat(kml, notNullValue());
Polygon kmlPolygon = ((Polygon) ((Placemark) kml.getFeature()).getGeometry());
assertThat(kmlPolygon, notNullValue());
org.locationtech.jts.geom.Geometry jtsGeometryPolygon = KmlToJtsGeometryConverter.from(kmlPolygon);
assertThat(jtsGeometryPolygon, instanceOf(org.locationtech.jts.geom.Polygon.class));
assertSpecificGeometry(kmlPolygon, jtsGeometryPolygon);
}
Aggregations