Polygon segments as great circles

763 views
Skip to first unread message

deanwilk

unread,
Feb 8, 2008, 7:22:37 PM2/8/08
to KML Developer Support - Getting Started with KML
I have a polygon defined according to a number of lat, long points. I
use <altitudeMode>clampToGround</altitudeMode>, which is suppose
to cause the LinearRing to follow a great circle route between polygon
verticies, according to the KML 2.2 documentation. But, it doesn't!
Can anyone help?

deanwilk

Jonathan van Tuijl

unread,
Feb 8, 2008, 7:44:01 PM2/8/08
to KML Developer Support - Getting Started with KML
I'll post the behavior I've seen in practice (as of some previous 4.2
version, IIRC):
- Any lines follow great circles.
- Same for unfilled polygons.
- Filled polygons are drawn on the lat/lon plane.

Google will have to answer why things are the way they are. I guess it
has to do with the difficulty of drawing great circle polygons. If you
watch closely you'll notice that tessellated lines, which do follow
great circles, seem to sample the terrain regularly instead of between
terrain polygons, a sign that they can't support great circles very
well at this time, probably not well enough to match great circle
polygons to the terrain.

Jonathan

barryhunter [KML Guru]

unread,
Feb 8, 2008, 7:49:32 PM2/8/08
to KML Developer Support - Getting Started with KML
I wonder are you possibly thinking of the <tessellate> option? that I
think causes the line to follow the terrain and it would probably be a
great circle line. clampToGround I think just makes the line have no
altitude.

Jonathan van Tuijl

unread,
Feb 8, 2008, 8:52:57 PM2/8/08
to KML Developer Support - Getting Started with KML
barryhunter [KML Guru] wrote:
> I wonder are you possibly thinking of the <tessellate> option? that I
> think causes the line to follow the terrain and it would probably be a
> great circle line. clampToGround I think just makes the line have no
> altitude.

A line without tessellation goes straight through the planet, whether
it's clampedToGround or not. It's only visible because GE biases the
depth test for lines. With tessellation it follows a great circle
path, *but it's not fitted to the terrain exactly*. A filled polygon
that's clampedToGround but without tessellate set (it will tessellate
in reality, and relativeToGround/absolute never will) is basically the
same as far as internals are concerned except taken to the next level
(surfaces > lines), and with a stringent requirement to fit exactly
and no geometry budget to make lots of tiny facets in two dimensions.
Add to that that which side of the polygon is the inside or outside is
not defined in terms of a round world (winding order would be the
solution, but KML doesn't care how polygons are winded), and you can
see why polygons with great-circle edges aren't there.

Now that I think of it, IIRC clamped filled polygons were implemented
differently in older versions. Currently they seem to be multitextured
over the terrain like a GroundOverlay, whereas they seemed more like
'true' geometry ages ago. Unfortunately I don't remember much more.
Let's wait for Google's reply to see if they can clear things up.

Jonathan

deanw

unread,
Feb 11, 2008, 1:07:09 PM2/11/08
to KML Developer Support - Getting Started with KML
Jonathan,
Thanks. As you note, tessellate set to zero makes the lines go
throught the earth. That's not what I want. In fact, I have tessellate
set to one in my KML code. I have a filled polygon, so it may be drawn
in the lat/lon plane, whatever that means. Again, the KML manual says
that Polygon line segments should follow a great circle path when
using "clampToGround", yet it does NOT. When I draw a line between two
of the polygon verticies, it DOES follow a great circle path.

So, I am still stuck. I am using a filled polygon to demonstrate a
large area on the earth's surface and it sure would be nice if the
lines between adjacent verticies were great circle lines!

I hope Google Earth can weigh in on this.

Dean


On Feb 8, 4:44 pm, Jonathan van Tuijl wrote:
> deanwilkwrote:

ManoM

unread,
Feb 11, 2008, 1:22:08 PM2/11/08
to KML Developer Support - Getting Started with KML
Hi Dean,

Can you post your KML so we can take a look at it?

ManoM

deanw

unread,
Feb 12, 2008, 2:30:33 PM2/12/08
to KML Developer Support - Getting Started with KML
Dear ManoM
Here is my KML code. If you plot this, note that the line segment that
runs through CANADA and the Great Lakes, i.e., between the points
(-113.30160, 62.75760, 0.0) and ( -76.02320, 41.87750, 0.0) is NOT
a great circle line. Same for the line segment just before this, as
one can see from the slight downward bow in the line segment. As for
the others, it is difficult to tell.

Thanks for taking a look at this.

Dean

*****************************************************

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name>Footprint-test</name>
<open>1</open>
<Style id="Footprint">
<LineStyle>
<color>ffffffff</color>
<width>1.5</width>
</LineStyle>
<PolyStyle>
<color>5000ffff</color>
</PolyStyle>
</Style>
<LookAt>
<longitude>-145.727000</longitude>
<latitude>63.95170000</latitude>
<altitude>0</altitude>
<range>7000000</range>
<tilt>0</tilt>
<heading>0</heading>
</LookAt>
<Placemark>
<name>Footprint-NMD</name>
<styleUrl>#Footprint</styleUrl>
<Polygon>
<tessellate>1</tessellate>
<altitudeMode>clampToGround</altitudeMode>
<outerBoundaryIs>
<LinearRing>
<coordinates>
-113.30160, 62.75760, 0.0
-76.02320, 41.87750, 0.0
-78.76540, 38.68310, 0.0
-82.15300, 36.20810, 0.0
-85.32860, 33.48420, 0.0
-88.32710, 30.46560, 0.0
-91.17540, 27.08360, 0.0
-93.89280, 23.23730, 0.0
-96.79450, 19.43370, 0.0
-98.93950, 13.42690, 0.0
-101.17560, 6.69740, 0.0
-107.36810, 10.81710, 0.0
-118.66460, 30.42130, 0.0
-126.82980, 41.42360, 0.0
-132.77830, 47.98610, 0.0
-137.55580, 55.67460, 0.0
-138.68610, 58.49990, 0.0
-138.81160, 59.59730, 0.0
-138.72520, 60.29830, 0.0
-138.55100, 60.82610, 0.0
-138.33450, 61.26320, 0.0
-138.05700, 61.63470, 0.0
-137.74070, 61.97240, 0.0
-137.36500, 62.28660, 0.0
-136.91680, 62.58950, 0.0
-136.36360, 62.89010, 0.0
-135.65030, 63.19820, 0.0
-134.65580, 63.52460, 0.0
-133.05330, 63.88370, 0.0
-129.29410, 64.27950, 0.0
-113.30160, 62.75760, 0.0
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>

****************************************************************
> > > Jonathan- Hide quoted text -
>
> - Show quoted text -

Jonathan van Tuijl

unread,
Feb 13, 2008, 8:36:25 AM2/13/08
to KML Developer Support - Getting Started with KML
deanw wrote:
> Jonathan,
> Thanks. As you note, tessellate set to zero makes the lines go
> throught the earth. That's not what I want. In fact, I have tessellate
> set to one in my KML code. I have a filled polygon, so it may be drawn
> in the lat/lon plane, whatever that means.

I meant that Google Earth draws filled polygons on a plane where the
axes are latitude and longitude. On that plane the edges of filled
polygons are straight. But of course, that plane has little meaning
when mapped onto an approximate sphere.

> Again, the KML manual says
> that Polygon line segments should follow a great circle path when
> using "clampToGround", yet it does NOT. When I draw a line between two
> of the polygon verticies, it DOES follow a great circle path.
>
> So, I am still stuck. I am using a filled polygon to demonstrate a
> large area on the earth's surface and it sure would be nice if the
> lines between adjacent verticies were great circle lines!
>
> I hope Google Earth can weigh in on this.

Yeah, I can only observe and hypothesize.

Jonathan

PriceCollins

unread,
Apr 3, 2008, 5:14:49 PM4/3/08
to KML Developer Support - Getting Started with KML
deanwilk,

See this posting "Polygons, Great Circles and Rhumb Lines in KML" at
http://bbs.keyhole.com/ubb/showflat.php/Cat/0/Number/1143582/


On Feb 8, 8:22 pm, deanwilk wrote:
> I have a polygon defined according to a number of lat, long points. I
> use       <altitudeMode>clampToGround</altitudeMode>, which is suppose
> to cause the LinearRing to follow agreatcircle route between polygon
Reply all
Reply to author
Forward
0 new messages