getView().copyAsLookAt(ALTITUDE_ABSOLUTE) still broken (6.1.0.4500)

203 views
Skip to first unread message

James Lamanna

unread,
Sep 7, 2011, 6:03:44 PM9/7/11
to KML Developer Support - Google Earth Plug-in
Hi,
getView().copyAsLookAt(ALTITUDE_ABSOLUTE) still returns 0 for target
altitude when over land, and bogus range values when underwater.
This is version 6.1.0.4500.

There is a workaround, but it results in 3x the number of API calls.

Thanks.

Brendan Kenny

unread,
Sep 19, 2011, 8:26:03 PM9/19/11
to KML Developer Support - Google Earth Plug-in
Hi James,
The 0 altitude is as intended. LookAts are overspecified and a single
view can be described with an infinite number of different LookAts.
The decision was made to represent the distance from the placemark via
only the range property.
It sounds like you are aware of this however (hence the "still" in
your message). I found this bug referring KML->Plugin->KML not
returning the same LookAt string (which can't be universally
guaranteed):
http://code.google.com/p/earth-api-samples/issues/detail?id=343
but no bug for the underwater range values. Would you mind filing one?
I'm also curious about your workaround, if you wouldn't mind
describing it.
Thanks!Brendan

James Lamanna

unread,
Sep 22, 2011, 11:55:40 AM9/22/11
to KML Developer Support - Google Earth Plug-in
Hi Brendan,
The workaround looks something like this:

cam = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_SEA_FLOOR);
cam.setAltitudeMode(ge.ALTITUDE_ABSOLUTE);
cam.setAltitude(ge.getGlobe().getGroundAltitude(cam.getLatitude(),
cam.getLongitude()));

However, the 0 altitude only makes sense if you are using altitude
relative to the ground (if you are looking at the ground).
I would think that ALTITUDE_ABSOLUTE would give you the absolute
altitude (the ground elevation) of the target on the earth.

I'll file a bug for the bogus values when you are underwater.

Here's an example of them:

CAM1 is using the workaround above.
CAM2 is ge.getView().copyAsLookAt(ge.ALTITUDE_ABSOLUTE);

CAM1 range: 11954.5352642897
CAM1 altitude: -4997.94751973414
CAM2 range: 1827560.67051247
CAM2 altitude: 0


-- James
Reply all
Reply to author
Forward
0 new messages