Search in sources :

Example 6 with Camera

use of org.geotoolkit.data.kml.model.Camera in project geotoolkit by Geomatys.

the class CameraTest method cameraReadTest.

@Test
public void cameraReadTest() throws IOException, XMLStreamException, KmlException, URISyntaxException {
    final KmlReader reader = new KmlReader();
    reader.setInput(new File(pathToTestFile));
    final Kml kmlObjects = reader.read();
    reader.dispose();
    final Feature feature = kmlObjects.getAbstractFeature();
    assertEquals(KmlModelConstants.TYPE_PHOTO_OVERLAY, feature.getType());
    final Camera camera = (Camera) feature.getPropertyValue(KmlConstants.TAG_VIEW);
    assertEquals(4, camera.getLongitude(), DELTA);
    assertEquals(43, camera.getLatitude(), DELTA);
    assertEquals(625, camera.getAltitude(), DELTA);
    assertEquals(2, camera.getHeading(), DELTA);
    assertEquals(1, camera.getTilt(), DELTA);
    assertEquals(2, camera.getRoll(), DELTA);
    assertEquals(EnumAltitudeMode.RELATIVE_TO_GROUND, camera.getAltitudeMode());
}
Also used : KmlReader(org.geotoolkit.data.kml.xml.KmlReader) Kml(org.geotoolkit.data.kml.model.Kml) Camera(org.geotoolkit.data.kml.model.Camera) File(java.io.File) Feature(org.opengis.feature.Feature) Test(org.junit.Test)

Aggregations

File (java.io.File)6 Camera (org.geotoolkit.data.kml.model.Camera)6 Kml (org.geotoolkit.data.kml.model.Kml)6 Test (org.junit.Test)6 Feature (org.opengis.feature.Feature)6 KmlReader (org.geotoolkit.data.kml.xml.KmlReader)3 KmlWriter (org.geotoolkit.data.kml.xml.KmlWriter)3 URI (java.net.URI)2 Calendar (java.util.Calendar)2 AnimatedUpdate (org.geotoolkit.data.gx.model.AnimatedUpdate)2 FlyTo (org.geotoolkit.data.gx.model.FlyTo)2 PlayList (org.geotoolkit.data.gx.model.PlayList)2 Wait (org.geotoolkit.data.gx.model.Wait)2 GxReader (org.geotoolkit.data.gx.xml.GxReader)2 GxWriter (org.geotoolkit.data.gx.xml.GxWriter)2 DefaultKmlFactory (org.geotoolkit.data.kml.DefaultKmlFactory)2 KmlFactory (org.geotoolkit.data.kml.KmlFactory)2 Change (org.geotoolkit.data.kml.model.Change)2 IconStyle (org.geotoolkit.data.kml.model.IconStyle)2 IdAttributes (org.geotoolkit.data.kml.model.IdAttributes)2