Polygon draw order problems between layers

157 views
Skip to first unread message

Mangocrate

unread,
Mar 5, 2008, 3:51:00 PM3/5/08
to KML Developer Support - Advanced Support for KML

I'm having a problem where I have four different polygon layers that
overlap in places - but I can't get GE to display them consistently in
a particular order.

Below are examples of what I'm trying to show:
http://www.freewebs.com/mangocrate/Long%20Range.kmz
http://www.freewebs.com/mangocrate/Standard%20High%20Resolution.kmz
http://www.freewebs.com/mangocrate/Standard%20Range.kmz
http://www.freewebs.com/mangocrate/Very%20High%20Resolution.kmz

No matter how I load the "very high resolution" polygons, they always
appear below one of the other layers. I've tried loading them above,
below, in different folders/etc - but with no luck.

Additionally, the 'outline' of the polygon is always drawn on top of
all polygons - which could be a 'feature' - but in my case it is just
plain frustrating.

I've tried tinkering with the altitude flag, but that just seems to
introduce different errors where the layer planes interfere with other
layers because of the large polygon size/mesh of the sphere - or
something.

If anybody has any suggestions to solve either problem (fill overlap
problem or outline overlap problem), I'd be appreciative.

stillinorbit

unread,
Mar 6, 2008, 11:32:27 AM3/6/08
to KML Developer Support - Advanced Support for KML
Mangocrate, you've stumbled into one of my biggest frustrations with
GE! This has consumed HOURS of my life, and as far as I can tell,
this is a GE bug. There is a partial solution:

1. Place all of your polygons into a single folder
2. Order the layers within the folder, with the top-most layer at the
top of the folder list. Layers with descending order of display
importance are listed sequentially down the list.
3. Save the folder as a .kml or .kmz
4. Exit GE
5. Restart GE and reload the .kml or .kmz

Ninety percent of the time, the layers will overlap according to your
list above. However, for some unknown reason, there are cases where
they won't - and I haven't found a solution. Grrr....

Maybe someone else has a better answer. Good Luck!

On Mar 5, 12:51 pm, Mangocrate wrote:
> I'm having a problem where I have four different polygon layers that
> overlap in places - but I can't get GE to display them consistently in
> a particular order.
>
> Below are examples of what I'm trying to show:http://www.freewebs.com/mangocrate/Long%20Range.kmzhttp://www.freewebs.com/mangocrate/Standard%20High%20Resolution.kmzhttp://www.freewebs.com/mangocrate/Standard%20Range.kmzhttp://www.freewebs.com/mangocrate/Very%20High%20Resolution.kmz

Mangocrate

unread,
Mar 6, 2008, 2:08:45 PM3/6/08
to KML Developer Support - Advanced Support for KML

Great! - I'm in the 10% - oh wait - that's a bad thing....

That didn't work for me. Something is broken with how GE works with
layering.

On Mar 6, 11:32 am, stillinorbit wrote:
> Mangocrate, you've stumbled into one of my biggest frustrations with
> GE! This has consumed HOURS of my life, and as far as I can tell,
> this is a GE bug. There is a partial solution:
>
> 1. Place all of your polygons into a single folder
> 2. Order the layers within the folder, with the top-most layer at the
> top of the folder list. Layers with descending order of display
> importance are listed sequentially down the list.
> 3. Save the folder as a .kml or .kmz
> 4. Exit GE
> 5. Restart GE and reload the .kml or .kmz
>
> Ninety percent of the time, the layers will overlap according to your
> list above. However, for some unknown reason, there are cases where
> they won't - and I haven't found a solution. Grrr....
>
> Maybe someone else has a better answer. Good Luck!
>
> On Mar 5, 12:51 pm, Mangocrate wrote:
>
> > I'm having a problem where I have four different polygon layers that
> > overlap in places - but I can't get GE to display them consistently in
> > a particular order.
>
> > Below are examples of what I'm trying to show:http://www.freewebs.com/mangocrate/Long%20Range.kmzhttp://www.freeweb...

Jonathan van Tuijl

unread,
Mar 7, 2008, 6:55:32 AM3/7/08
to KML Developer Support - Advanced Support for KML
stillinorbit wrote:
> Mangocrate, you've stumbled into one of my biggest frustrations with
> GE!   This has consumed HOURS of my life, and as far as I can tell,
> this is a GE bug.

Google said that's just how it works.

> Maybe someone else has a better answer.  Good Luck!

People have had success by setting different altitudes, even though
the polygons are clamped to the ground. Altitude acts much like z
order in that case (or acted - haven't tested recently).

Jonathan

Mangocrate

unread,
Mar 7, 2008, 9:27:23 AM3/7/08
to KML Developer Support - Advanced Support for KML

Unfortunately my polygons are at a zero-elevation (ocean) and on the
larger side. GE doesn't do well where the elevation mesh is coarse.
The altitude required to prevent plane intersections between the
polygons are pretty severe - with my 4 zones each would have to have
an altude of ~1000m above each lower one. The highest one ends up
being too high - especially since this is a marine concept....

Jonathan van Tuijl

unread,
Mar 7, 2008, 11:29:37 AM3/7/08
to KML Developer Support - Advanced Support for KML
Mangocrate wrote:
> Unfortunately my polygons are at a zero-elevation (ocean) and on the
> larger side.  GE doesn't do well where the elevation mesh is coarse.
> The altitude required to prevent plane intersections between the
> polygons are pretty severe - with my 4 zones each would have to have
> an altude of ~1000m above each lower one.  The highest one ends up
> being too high - especially since this is a marine concept....

clampToGround still clamps polygons to the ground even if you set an
altitude.

Jonathan

Mangocrate

unread,
Mar 7, 2008, 12:39:50 PM3/7/08
to KML Developer Support - Advanced Support for KML

Wow! Thanks Jonathan - that worked:
http://www.freewebs.com/mangocrate/hfr_ranges.kmz

To do it I added a slight elevation to each layer (25m each - bottom
layer had an elevation of 1). In an editor I changed all strings of
"relativeToGround" with "clampToGround" since the GE dialog box forces
all clampToGround options to strip the elevation flag of the poly
string.

The KML docs say that clampToGround ignores the elevation - but
thankfully it doesn't.

Very happy now. A bit of a convoluted solution - but I'll take it.

stillinorbit

unread,
Mar 9, 2008, 12:15:13 PM3/9/08
to KML Developer Support - Advanced Support for KML
Hey, it works for me, too. Although, it seems that I cannot adjust
the various polygon elevations directly in the kml; it has to be done
in the viewer first before I change relativeToGround to clampToGround
in the kml.

Ummm... It sure would be an asset if the draw order could be set for
polygons and paths just like it can be set for image overlays!

-S
Reply all
Reply to author
Forward
0 new messages