1
votes

I'm trying to put a filled polygon on the ground, following the surface, but up to now none of my trials succeeded. I always get either a filled polygon hovering at some specific height (sometimes cutting through the terrain surface, depending on that height) or a mere outline of the polygon without any filling. I tried

  • setting the height information to 0 (in coordinates and with tag altitude),
  • setting the altitudeMode to clampToGround (and clampToSeaFloor),
  • using the namespace extension gx, but all to no avail.
  • using tag tessellate (0 and 1),
  • using tag extrude (0 and 1 and even higher values),
  • turning the order of the polygon points around (to switch from clockwise to counterclockwise),

but nothing worked.

Here is an example which I think is correct but doesn't work (this one shows no filling for the polygon, just the outline):

<?xml version="1.0" encoding="UTF-8"?>
<kml>
  <Placemark>
    <name>Filled Polygon Example</name>
    <visibility>1</visibility>
    <Style>
      <LineStyle>
        <color>FF00FFFF</color>
        <width>1</width>
      </LineStyle>
      <PolyStyle>
        <fill>1</fill>
        <outline>1</outline>
        <color>FF0000FF</color>
      </PolyStyle>
    </Style>
    <Polygon>
      <extrude>1</extrude>
      <altitudeMode>clampToGround</altitudeMode>
      <tessellate>1</tessellate>
      <outerBoundaryIs>
        <LinearRing>
          <coordinates>
            13.213,52.793,0
            13.202,52.803,0
            13.218,52.829,0
            13.226,52.807,0
            13.213,52.793,0
          </coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>
  </Placemark>
</kml>

If you replace clampToGround by e. g. relativeToGround, you get the filling of the polygon, but it isn't following the surface but cutting flat through it.

I'm using Google Earth version 7.1.8 on Ubuntu 16.04.

What's curious is that I found some (quite old) forum posts which stated that this worked once (around 2006), unfortunately without a complete example. Is this a dropped feature?

I would be happy if anybody could provide an example KML which displays a filled polygon on the surface of the earth in Google Earth.

1
GE Pro 7.1.8 on Windows shows this with clampToGround as a red filled polygon. Might be a Linux rendering issue. Have you tried any of the rendering options Tools / Options / 3D View; e.g. turn off anisotropic filtering, etc. - CodeMonkey
Thank you for the information that this seems to be a Linux issue! I didn't try out various options, but now I did, but nothing changed. Then I tried out using a Windows version (in Wine, an emulator). Interestingly, there it worked! :-) So I'll concede that this is a missing feature in the Linux implementation of Google Earth and has no programming aspect that I'm doing wrong :-/ - Alfe

1 Answers

0
votes

As @jasonm1 pointed out in a comment, the problem doesn't exist in the Windows version. I tried out switching graphic options but nothing helped. Then I tried the Windows version in an emulator (Wine). There the code above and my real code worked without a problem. Overlaying filled polygons with clampToGround worked also as expected. Google Earth in general seems to be very well supported by Wine, so for now this fixes my issue.

Would be nicer to have a decent native Google Earth on Linux, though.