use of org.geotoolkit.data.kml.model.LatLonBox in project geotoolkit by Geomatys.
the class GroundOverlayTest method groundOverlayReadTest.
@Test
public void groundOverlayReadTest() throws IOException, XMLStreamException, KmlException, URISyntaxException {
final KmlReader reader = new KmlReader();
reader.setInput(new File(pathToTestFile));
final Kml kmlObjects = reader.read();
reader.dispose();
final Feature groundOverlay = kmlObjects.getAbstractFeature();
assertEquals(KmlModelConstants.TYPE_GROUND_OVERLAY, groundOverlay.getType());
assertEquals("GroundOverlay.kml", groundOverlay.getPropertyValue(KmlConstants.TAG_NAME));
assertEquals("7fffffff", KmlUtilities.toKmlColor((Color) groundOverlay.getPropertyValue(KmlConstants.TAG_COLOR)));
assertEquals(1, groundOverlay.getPropertyValue(KmlConstants.TAG_DRAW_ORDER));
final Icon icon = (Icon) groundOverlay.getPropertyValue(KmlConstants.TAG_ICON);
assertEquals("http://www.google.com/intl/en/images/logo.gif", icon.getHref());
assertEquals(RefreshMode.ON_INTERVAL, icon.getRefreshMode());
assertEquals(86400, icon.getRefreshInterval(), DELTA);
assertEquals(0.75, icon.getViewBoundScale(), DELTA);
final LatLonBox latLonBox = (LatLonBox) groundOverlay.getPropertyValue(KmlConstants.TAG_LAT_LON_BOX);
assertEquals(37.83234, latLonBox.getNorth(), DELTA);
assertEquals(37.832122, latLonBox.getSouth(), DELTA);
assertEquals(-122.373033, latLonBox.getEast(), DELTA);
assertEquals(-122.373724, latLonBox.getWest(), DELTA);
assertEquals(45, latLonBox.getRotation(), DELTA);
}
Aggregations