Polygon Pattern Fill

3,084 views
Skip to first unread message

IBB

unread,
Sep 24, 2007, 10:54:02 AM9/24/07
to KML Developer Support - Advanced Support
Hello,

Is there such thing as a "pattern fill" in KML? For instance, I would
like to be able to fill a polygon with a diagonal line pattern, but so
far have only been able to figure out how to fill with an rgb. Anyone
have any suggestions/tips/comments?

Thanks.

simon_a

unread,
Sep 24, 2007, 4:57:42 PM9/24/07
to KML Developer Support - Advanced Support
Hello,

No, not an option at this stage (unless you want to draw the lines
yourself!). You could look at using different levels of opacity to
give it a bit more variation. Other than that, it would have to be an
image overlay.

:-)

Simon.

Jonathan van Tuijl

unread,
Sep 24, 2007, 5:15:03 PM9/24/07
to KML Developer Support - Advanced Support

You can try creating your pattern from geometric primitives if it's
not too complex. That would look like this:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Placemark>
<name>Pattern fill</name>
<Style>
<LineStyle>
<color>ff008000</color>
<width>4</width>
</LineStyle>
<PolyStyle>
<color>ff00ffff</color>
</PolyStyle>
</Style>
<MultiGeometry>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>-2,-2 2,-2 2,2 -2,2 -2,-2</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
<LineString>
<coordinates>-2,-1 -1,-2</coordinates>
</LineString>
<LineString>
<coordinates>-2,0 0,-2</coordinates>
</LineString>
<LineString>
<coordinates>-2,1 1,-2</coordinates>
</LineString>
<LineString>
<coordinates>-2,2 2,-2</coordinates>
</LineString>
<LineString>
<coordinates>-1,2 2,-1</coordinates>
</LineString>
<LineString>
<coordinates>0,2 2,0</coordinates>
</LineString>
<LineString>
<coordinates>1,2 2,1</coordinates>
</LineString>
</MultiGeometry>
</Placemark>
</kml>

Another option is a ground overlay with the pattern.

Jonathan

IBB

unread,
Sep 25, 2007, 8:48:41 AM9/25/07
to KML Developer Support - Advanced Support
Thanks for the replies. My KML is generated server side based on
dynamic point data, so using the primitives might get a bit dicey.

I'll take a look into the ground overlay, but again, with the dynamic
polygon shapes that are being produced, I have a feeling it might skew
the image a little bit too much.

Any other ideas floating out there?

Reply all
Reply to author
Forward
0 new messages