ramazanalic / kml-samples

Automatically exported from code.google.com/p/kml-samples
0 stars 0 forks source link

Placemarks viewed at angle, with terrain ON, and Elev Exag <1, appear in wrong place using gx:altitudeMode or altitudeMode #275

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Which products are affected?

      Google Earth 5 Beta on Macintosh G5 (May 5th) and all before

What steps will reproduce the problem?

     1. Create a placemark (see code below), with a clamped to ground position, viewed at 45° tilt.
     2. Set terrain ON and set elevation exaggeration to 0.9999
     3. Placemark appears at incorrect location on image

What is the expected output or behavior? What do you see instead?

    Repeating the above steps with elevation Exaggeration set to 1.0 gives totally predictable 
behaviour.

    There is essentially no numeric difference between these two numbers (1.0 and 0.9999) and 
behaviour should be the same for each. At 100m elevation it amounts to 10mm.

    This behaviour has been noted for version 4.3 on G5 and Intel Macs (OSX 10.4.11 and OSX 
10.5. It has also been demonstrated with version 4.3 on PC under XP.

Behaviour is identical with gx:altitudeMode or altitudeMode under GE5

    My theory is that the map layer is incorrectly located in this situation, and the oblique view 
shows the bug up. Yet the cursor coords seem correct?

What application versions (if any) are you using?

    Google Earth 5.0.11733.9347  Build Date May 5, 2009

Which operating systems and browsers are affected?

    OSX 10.4.11  but I believe also under OSX 10.5 and Windows XP

Please provide any additional information (code snippets/links) below.

This is the code for the placemark

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" 
xmlns:gx="http://www.google.com/kml/ext/2.2" 
xmlns:kml="http://www.opengis.net/kml/2.2" 
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
   <name>KmlFile</name>
   <Style id="sn_ylw-pushpin">
      <IconStyle><scale>1.1</scale>
         <Icon>
            <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
         </Icon>
         <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
      </IconStyle>
   </Style>
   <Placemark>
      <name>Placemark</name>
      <LookAt>
         <longitude>175.070</longitude><latitude>-39.109</latitude>
         <range>500</range><tilt>45</tilt><heading>0</heading><altitude>0</altitude>
         <gx:altitudeMode>clampToGround</gx:altitudeMode>
      </LookAt>
      <styleUrl>#sn_ylw-pushpin</styleUrl>
      <gx:altitudeMode>clampToGround</gx:altitudeMode>
      <Point><coordinates>175.070,-39.109,0</coordinates></Point>
   </Placemark>
</Document>
</kml>

Behaviour is the same for most combinations of the altitude mode line

      <gx:altitudeMode>clampToGround</gx:altitudeMode>
      <altitudeMode>clampToGround</altitudeMode>
      <gx:altitudeMode>relativeToGround</gx:altitudeMode>
     <altitudeMode>relativeToGround</altitudeMode>

and using absolute altitude (127m) i.e.

    <gx:altitudeMode>absolute</gx:altitudeMode>
      <Point><coordinates>175.070,-39.109,127</coordinates></Point>

    <altitudeMode>absolute</altitudeMode>
      <Point><coordinates>175.070,-39.109,127</coordinates></Point>

The view coordinates do not seem to matter.

The only fix that I am aware of is to avoid Elevation Exaggeration <1.0 (other 
than 0.0)
It manifests in different ways - often the labels disappear below ground. icons 
appear at the 
wrong size, or if you rotate the compass the spin in mid air even though 
'clamped to ground'.

I have posted a few times on this issue - each time it gets simpler to explain.

It really needs attention!

BobJordanB

Original issue reported on code.google.com by b_jor...@xtra.co.nz on 17 May 2009 at 10:41

GoogleCodeExporter commented 8 years ago
Sorry,

I have incorrectly put my <altitudeMode> outside the <Point> pair. So this will 
default to clampToGround.

But the problem is the same, as the default for this var. is clampToGround.

Correct kml below shows behaviour described as in original post. It should be:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" 
xmlns:gx="http://www.google.com/kml/ext/2.2" 
xmlns:kml="http://www.opengis.net/kml/2.2" 
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
   <name>KmlFile2</name>
   <Style id="sn_ylw-pushpin">
      <IconStyle><scale>1.1</scale>
         <Icon>
            <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
         </Icon>
         <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
      </IconStyle>
   </Style>
   <Placemark>
      <name>Placemark</name>
      <LookAt>
         <longitude>175.070</longitude><latitude>-39.109</latitude>
         <gx:altitudeMode>clampToGround</gx:altitudeMode><altitude>0</altitude>
         <range>500</range><tilt>45</tilt><heading>0</heading>
</LookAt>
      <styleUrl>#sn_ylw-pushpin</styleUrl>
      <Point>
         <gx:altitudeMode>clampToGround</gx:altitudeMode>
         <coordinates>175.070,-39.109,0</coordinates>
      </Point>
   </Placemark>
</Document>
</kml>

Apologies for screwup.

BobJordanB

Original comment by b_jor...@xtra.co.nz on 17 May 2009 at 8:08

GoogleCodeExporter commented 8 years ago
I'm surprised others cannot duplicate this. Am I posting in the wrong place? Am 
I doing something wrong?
This seems a major issue with the way that Google earth locates placemarks 
vertically when elevation 
exaggeration is less that 1.0.

Can someone comment please.

Bob J.

Original comment by b_jor...@xtra.co.nz on 25 May 2009 at 10:15