KML Polygon Fill Colours

3,456 views
Skip to first unread message

alcu

unread,
Nov 15, 2006, 5:45:34 AM11/15/06
to KML Discussions
Hi all,

Apologies if this has already been previously discussed - I had a look but couldn't see it anywhere.

I have a reasonably large vector dataset which I have translated from MapInfo TAB format into KML (using FME). When I first loaded it into Google Earth it had retained all the polygon fill colours and looked as it had in MapInfo. However, after a couple of days working with it the layer now appears to have lost its colours and the polygons only have the outline and no fill. When I look at each polygon in "My Places" eah polygons still has the correct style associated to it, it's just that GE is not displaying it.

In addition, I have another vector dataset which I have imported. I can set an outline colour for this but whatever fill I set is just not displayed.

How can I get the fill colours to display? Has anyone encountered this before and is it a known problem? Is there a way to fix it?

Thanks for any help you can offer,

Paul


Google Earth Pro 4.0.2416 (beta)
Build Date Oct 31 2006
Build Time 20:11:20
Renderer DirectX 8
Operating System Microsoft Windows XP (Service Pack 2)
Max Texture Size 4096x4096
Server Primary Database

ManoM

unread,
Nov 15, 2006, 10:03:01 AM11/15/06
to KML Discussions
Hi alcu,

Could you post your code so we can see if we can replicate the problem?

Thanks,
ManoM

BrianT

unread,
Nov 15, 2006, 9:52:25 PM11/15/06
to KML Discussions
Alcu:

Knowing nothing about your case, I would nonetheless look into the graphics card first. Polygon fills seem to particularly stress the graphics capabilities of older/minimum spec cards and I've had layers that just didn't display any fills on older machines.

BT

Robi

unread,
Nov 15, 2006, 10:49:02 PM11/15/06
to KML Discussions
Hi ManoM, I have a similar "problem"
I am in the process of creating London Wards and the fill color is just not working right at times (or at least it seems to me):

all wards in the image are the same green, but one seems to be a darker green or even black with 50% opacity.
what is causing this? I have others that are just like that one -different colors but seem to be a opaque black with a tint of the color.
Attached is a partial of the Westminster Wards.
685986-CityofWestminsterWards.kml

Chris198

unread,
Nov 16, 2006, 5:02:52 AM11/16/06
to KML Discussions
In regards to the black polygon issue, i was having the same problems when drawing wind turbines using polygons. I was drawing a mesh of the turbine, and then filling each panel is as a polygon. The majority of my coloured wind turbine was coming out black no the white i was wanting. Turns out you have to draw the polygon anticlockwise, if you draw it clockwise then the lighting will be all correct and the colour displays as is should. It worked for my turbines

JoseGil

unread,
Nov 16, 2006, 5:19:42 AM11/16/06
to KML Discussions
Robi,

Edit the St James polygon: select Altitude + change something (p.i. select "Clamped to ground" and, after, select again "Absolute") + OK. The problem will be automatically solved.

I'm not sure, but I think the cause of the problem is that the St James polygon is not well constructed.

Jose

PD: Apologize for my English

JoseGil

unread,
Nov 16, 2006, 5:28:27 AM11/16/06
to KML Discussions
Quote:

if you draw it clockwise then the lighting will be all correct and the colour displays as is should




Thanks Chris,

I had the same problem.

Jose

Chris198

unread,
Nov 16, 2006, 5:51:10 AM11/16/06
to KML Discussions
Urgh i mucked up the crucial sentence in that statement! lol

What i meant to say is that if you draw it ANTICLOCKWISE, the lighting will be correct and the colour will display correctly.

As an example, if you draw a cube, with each panel a seperate polygon, if you draw the polygon points clockwise the cube will appear dark, as all the lighting will effectivley be inside the box, only when you draw the points anticlockwise will the outside of the box be lit correctly. Hope that helps!

Robi

unread,
Nov 16, 2006, 6:39:38 AM11/16/06
to KML Discussions
Hola JoseGil,
Gracias, but somehow changing the altitude mode didn't work for me, it kept doing it.

Hi Chris,
thanks for the counterclockwise tip. worked like a charm.
somewhat I believe this to be a bug , but then again it could be a feature

Chris198

unread,
Nov 16, 2006, 7:53:50 AM11/16/06
to KML Discussions
Quote:

somewhat I believe this to be a bug




I don't think its a bug, the lighting is prob quite a useful feature, but in the case of my wind turbines i would just rather all the polygons were white rather than having them shaded on one side. However, making everyone draw them anticlockwise is a good thing because in a sense it makes you all confirm to drawing them the same way, and it means GE knows exactly how the polygon should be drawn, and which way it is facing.

So i guess it is a feature rather than a bug

alcu

unread,
Nov 16, 2006, 8:03:52 AM11/16/06
to KML Discussions
Hi all,

Thanks to those who responded Sorry for the delayed response to my initial post but I hope to shed a bit more light on the issue here.

BrianT - I'm running a GeForce 7600GT with the latest drivers (128MB). Maybe this is the issue?

ManoM - I can't really post my data I'm afraid but I think I'm starting to narrow down the issue:

In my first post I mentioned a large vector dataset that wasn't displaying and another dataset that wasn't either. I tried again last night and the first was now displaying okay again but the second wasn't still which leads me to believe the second one is the problem dataset. At the bottom of this message I include the KML for this dataset but I've stripped all polygons from it except two very small ones.

It seems that the issue might be one of two things:

- The suspect dataset contains one very big polygon with about 32,000 vertices / nodes (I have stripped this polygon from the code below). I have never seen this polygon with a fill. Could this number of vertices be making my graphics card struggle?

- I haven't checked but it is possible the polygon does not have the correct rotation (clockwise or counter-clockwise). I noticed in some of the responses to my original post that this was suggested as an issue?

It does seem completely random whether the fills work. I've just tried again and I can't get any vector datasets to fill correctly. I think maybe that this happens when I open the suspect dataset first which it can;t handle and then none of the others work either.

Hope you can help!

Cheers, Paul


<?xml version="1.0" encoding="windows-1252"?>
<kml xmlns="http://earth.google.com/kml/2.0">

<Document>
<visibility>1</visibility> <Style id="kml_FT_FC_style">
<IconStyle>
</IconStyle>
<balloonStyle>
</balloonStyle>
<LineStyle>
</LineStyle>
<LabelStyle>
</LabelStyle>
<PolyStyle>
</PolyStyle>
</Style>
<Folder>
<name>FC_300 </name> <Placemark>
<description><!CDATA[<center><table><tr><th colspan='2' align='center'><em>Attributes</em></th></tr><tr bgcolor='#E3E3F3'><th>Lower</th><td>-2200.7045</td></tr><tr bgcolor=''><th>Upper</th><td>0</td></tr></table></center>]]></description><Snippet></Snippet> <styleUrl>#kml_FT_FC_style</styleUrl> <Style >
<IconStyle>
</IconStyle>
<balloonStyle>
</balloonStyle>
<LineStyle>
<color>ff000000</color> </LineStyle>
<LabelStyle>
</LabelStyle>
<PolyStyle>
<color>b0ff0000</color> </PolyStyle>
</Style>
<GeometryCollection><Polygon>
<outerBoundaryIs><LinearRing><coordinates>1.67299651424525,52.3152015972251,0 1.6730050246098,52.3152193220746,0 1.67302081396087,52.3152223058469,0 1.67302668184927,52.3152186478467,0 1.67304910431692,52.3152094749832,0 1.67306061979486,52.3151996014993,0 1.67306277102945,52.3151815447353,0 1.67304563677043,52.3151676406359,0 1.67301640170372,52.3151690735973,0 1.67299791599902,52.3151835637951,0 1.67299651424525,52.3152015972251,0</coordinates></LinearRing></outerBoundaryIs></Polygon><Polygon>
<outerBoundaryIs><LinearRing><coordinates>1.63882238011178,52.3364268188688,0 1.63883384951783,52.3364347519509,0 1.63886268255494,52.3364282460004,0 1.63888736041543,52.3364428047561,0 1.63889346736119,52.3364454880515,0 1.6389020319134,52.3364603419289,0 1.63890213791953,52.3364603386601,0 1.63890066090823,52.3364423946261,0 1.63889918477095,52.3364244505652,0 1.6388977112624,52.3364065065419,0 1.63889623840002,52.3363885623799,0 1.63889613239405,52.3363885656487,0 1.63888960050988,52.3363984333277,0 1.63886026929744,52.3363988794354,0 1.63883159673632,52.3364073379841,0 1.63883022774784,52.3364085874263,0 1.63882238011178,52.3364268188688,0</coordinates></LinearRing></outerBoundaryIs></Polygon></GeometryCollection> </Placemark>

</Folder>

</Document>

</kml>

JoseGil

unread,
Nov 16, 2006, 8:58:05 AM11/16/06
to KML Discussions
I supose you have a problem with your graphic card because I can see both polygons.

Jose

PD: <GeometryCollection> tag has been deprecated in KML 2.1. You should use <MultiGeometry> instead.

JoseGil

unread,
Nov 16, 2006, 10:44:02 AM11/16/06
to KML Discussions
Quote:

...because I can see both polygons




Maybe the problem is that they are really small (4 and 5 m width)

Jose

ManoM

unread,
Nov 16, 2006, 11:57:37 AM11/16/06
to KML Discussions
Hi Paul,

It took me awhile to find these polygons because they are so tiny, but yes I can see them correctly. I cannot diagnose what's wrong with the full file without seeing it, of course. There are a few general troubleshooting things you can look at

1) Make sure the first coordinate is the same as the last.

2) The number of coordinates can be a problem, yes. GE does not publish the exact limit of coordinates, but 32,000 does sound like a lot.

3) Having a modern graphics card with the latest drivers seems unlikely to be the problem. Usually problems with cards stem from the card being damaged, old, or not having the latest drivers.

4) If you're using DirectX 8, you might try upgrading to the latest DirectX, 9.0c. If that doesn't work, try switching to OpenGL mode and see if that helps.

If you can post the rest of your code as an attachment, then we might be able to learn more.

ManoM

alcu

unread,
Nov 20, 2006, 4:11:46 PM11/20/06
to KML Discussions
Thanks for all the advice on this.

Finally managed to get back into the office today to manipulate the datasets. I split the large polygon with 32000 vertices down into a number of smaller polygons. I translated this into KML and have just tried it in GE. It works fine with fill and line styles displaying correctly.

It seems that the issue was with this one polygon which was then causing issues with all my other vector datasets.

Therefore, I think the moral of the story is to keep your polygons small!

Thanks again for your time.

Paul

Canoro

unread,
Dec 12, 2006, 6:09:59 AM12/12/06
to KML Discussions
One thing that affects directly the polygons is if you're running Google Earth in Safe Mode. Safe Mode doesn't show the fill of the polygons, just the outline.
To change to normal mode go to Tools > Options > 3D View > Graphics Mode > and disable the box of Safe Mode activation. you're going to have to restart Google Earth after this.
hope this helps!
Reply all
Reply to author
Forward
0 new messages