KML Polygon color fill does not render properly

400 views
Skip to first unread message

jarock65

unread,
Apr 14, 2009, 2:28:48 PM4/14/09
to KML Developer Support - Getting Started with KML
I am using GE to display water depth information about the Gulf of
Maine. The data I have is fairly detailed and complex. I'm trying to
fill each polygon so that I can visually display the changes in water
depth. The problem I am having is that only some of the polygons
actually are displayed with the fill color I have assigned. It seems
to me that as long as the polygon only has a single <LinearRing>
element within the <outerBoundaryIs> and <innerBoundaryIs> then the
fill color is displayed. If multiple <LinearRing> elements are used
then GE does not display properly. However I tested this by simply
removing the <innerBoundaryIs> element and tried to add color fill...
still could not get the poly to display a color fill. It will display
an outline but not a fill Below are links to snippets of my KML file.
The KML file that "works" will display properly and the KML file that
"DoesntWork" will not. Any ideas about how to fix this?
Thank you.


Works: http://edesign.ecs.umass.edu/pub/Justin/KML_files/Works.xml
DoesntWork: http://edesign.ecs.umass.edu/pub/Justin/KML_files/DoesntWork.xml

jarock65

unread,
Apr 14, 2009, 7:58:54 PM4/14/09
to KML Developer Support - Getting Started with KML
So I'm still trying to figure this out and I've created a simpler Poly
that only has an <outerBoundaryIs> and NOT any <innerBoundaryIs>
element. I can NOT get GE to render this Poly with a Fill Color. Is
there a limitation to what polygons can be filled with color? The
thing is I have gotten GE to render a fill color for a more complex
poly. The two files below illustrate what I'm talking about. Please
help KML GURU!!

This is the poly that I can't get to fill:
http://edesign.ecs.umass.edu/pub/Justin/KML_files/PolyWithoutFill.xml

This one is more complex but I can get it to fill
http://edesign.ecs.umass.edu/pub/Justin/KML_files/PolyWithFill.xml

vzett

unread,
Apr 15, 2009, 7:57:05 AM4/15/09
to KML Developer Support - Getting Started with KML
Justin,
Looking at your non-working examples the polygons which don't fill
appear to have spots where the points recross each other - basically
little loops - which effectively means these are degenerate polygons.
This is likely causing the problem as Google Earth doesn't understand
how to 'fill' something which crosses itself.

See near 40.488997,-69.868805 in your 'doesn't work' example in your
1st post.

Otherwise, looks like a fun project.

- Virgil

Virgil Zetterlind
www.earthnc.com
www.maplify.com


On Apr 14, 6:58 pm, jarock65 wrote:
> So I'm still trying to figure this out and I've created a simpler Poly
> that only has an <outerBoundaryIs> and NOT any <innerBoundaryIs>
> element. I can NOT get GE to render this Poly with a Fill Color. Is
> there a limitation to what polygons can be filled with color? The
> thing is I have gotten GE to render a fill color for a more complex
> poly. The two files below illustrate what I'm talking about. Please
> help KML GURU!!
>
> This is the poly that I can't get to fill:http://edesign.ecs.umass.edu/pub/Justin/KML_files/PolyWithoutFill.xml
>
> This one is more complex but I can get it to fillhttp://edesign.ecs.umass.edu/pub/Justin/KML_files/PolyWithFill.xml
Reply all
Reply to author
Forward
0 new messages