Freitag, 15. Januar 2010

Google Earth: Move Camera to certain Viewpoint

Problem:
How do I move the camera to a certain viewpoint, given as [world coordinates, height, azimuth and elevation] in Google Earth?

I recently had to re-stage some perspective aerial photos, knowing the location and height of the plane, as well as the viewing direction. Unfortunately, the Google Earth (5.0) UI does not seem to offer a possibilty to just enter those viewpoint parameters.
Now, the trick is to use placemarks: set a placemark somewhere and open its properties dialog.
In this dialog, we can enter the exact coordinates, azimuth and elevation. So far so good, but it's not yet perfect:
We can also specify the height in this dialog, but this will only move the placemark up in the air - not our viewpoint! The camera will always hover around the projection of the placemark on the ground level. But again there is a dodge to get this working:
Save your viewpoint as KML (plaintext), and open it with a text editor. You will see the xml-structure of the KML file, containing all the information about our placemark including the viewing direction:


<?xml version="1.0" encoding="UTF-8"?>
<kml ...>
<Document>
    <name>aerialviewpoint.kml</name>
    <Placemark>
        <name>my point in the air</name>
        <open>1</open>
        <LookAt>
            <longitude>8.765</longitude>
            <latitude>47.474</latitude>
            <altitude>1000</altitude>
            <range>1</range>
            <tilt>85</tilt>
            <heading>120</heading>
            <altitudeMode>absolute</altitudeMode>
        </LookAt>
        <Point>
            <extrude>1</extrude>
            <altitudeMode>absolute</altitudeMode>
            <coordinates>8.765,47.474,1000</coordinates>
        </Point>
    </Placemark>
</Document>
</kml>

Here we can change the height of the viewpoint (field altitute in the -Tag) to our desired height. Then save and reopen the KML file with Google Earth, where we will fly directly to this viewpoint. []

Keine Kommentare:

Kommentar veröffentlichen