32-bit color code vs 24-bit color code

86 views
Skip to first unread message

Pal

unread,
Mar 18, 2009, 2:03:41 AM3/18/09
to KML Developer Support - Getting Started with KML
Hi,

Is somebody aware of the anomalies with Google earth using 32-bit
color code for color representation in KML while google map uses 24-
bit color code?

Is there any workaround, if I wanna use the same KML file for both map
and google earth?

Thanks,
Amit

Roman N

unread,
Mar 20, 2009, 10:16:17 PM3/20/09
to KML Developer Support - Getting Started with KML
Hi Amit,

The KML standard only defines one color format: aabbggrr (32-bit).
Google Maps should be conforming to this. If it's not, can you post a
link to the KML that's rendering improperly?

Thanks,
- Roman

Pal

unread,
Mar 30, 2009, 2:49:42 PM3/30/09
to KML Developer Support - Getting Started with KML
Hi Roman,

I couldn't find any option to attach file so I am pasting it here:

<!-- edited with XMLSpy v2005 sp1 U (http://www.xmlspy.com) by Amit
Pal (Vitria Technology Limited) -->
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name>WeatherAlerts.kml</name>
<Style id="Severe Thunderstorm Warning">
<IconStyle>
<color>FF9933</color>
</IconStyle>
</Style>
<Style id="Blizzard Warning">
<IconStyle>
<color>FF3300</color>
</IconStyle>
</Style>
<Style id="Winter Storm Warning">
<IconStyle>
<color>FF66CC</color>
</IconStyle>
</Style>
<Style id="Storm Warning">
<IconStyle>
<color>993399</color>
</IconStyle>
</Style>
<Style id="Flood Warning">
<IconStyle>
<color>00FF33</color>
</IconStyle>
</Style>
<Style id="Gale Warning">
<IconStyle>
<color>CC99CC</color>
</IconStyle>
</Style>
<Style id="Red Flag Warning">
<IconStyle>
<color>FF0000</color>
</IconStyle>
</Style>
<Style id="Freezing Rain Advisory">
<IconStyle>
<color>CC66CC</color>
</IconStyle>
</Style>
<Style id="Winter Weather Advisory">
<IconStyle>
<color>6633CC</color>
</IconStyle>
</Style>
<Style id="FloodAdvisory">
<IconStyle>
<color>00FF99</color>
</IconStyle>
</Style>
<Style id="High Surf Advisory">
<IconStyle>
<color>990099</color>
</IconStyle>
</Style>
<Style id="Heavy Freezing Spray Warning">
<IconStyle>
<color>0099FF</color>
</IconStyle>
</Style>
<Style id="Small Craft Advisory">
<IconStyle>
<color>CCCCFF</color>
</IconStyle>
</Style>
<Style id="Brisk Wind Advisory">
<IconStyle>
<color>CCCCFF</color>
</IconStyle>
</Style>
<Style id="Lake Wind Advisory">
<IconStyle>
<color>CCCC99</color>
</IconStyle>
</Style>
<Style id="Wind Advisory">
<IconStyle>
<color>CCCC99</color>
</IconStyle>
</Style>
<Style id="Frost Advisory">
<IconStyle>
<color>66CCFF</color>
</IconStyle>
</Style>
<Style id="Winter Storm Watch">
<IconStyle>
<color>00CCFF</color>
</IconStyle>
</Style>
<Style id="High Wind Watch">
<IconStyle>
<color>CC9933</color>
</IconStyle>
</Style>
<Style id="Fire Weather Watch">
<IconStyle>
<color>FFCC99</color>
</IconStyle>
</Style>
<Style id="Special Weather Statement">
<IconStyle>
<color>FFCC99</color>
</IconStyle>
</Style>
<Style id="Marine Weather Statement">
<IconStyle>
<color>FFCC99</color>
</IconStyle>
</Style>
<Style id="Hazardous Weather Outlook">
<IconStyle>
<color>CCCC66</color>
</IconStyle>
</Style>
<Style id="Short Term Forecast">
<IconStyle>
<color>99FF33</color>
</IconStyle>
</Style>
<Folder>
<name>Flood Advisory</name>
<Placemark>
<name>Flood</name>
<description><![CDATA[FLOOD ADVISORY NATIONAL WEATHER SERVICE
SACRAMENTO CA<br/>]]></description>
<styleUrl>#FloodAdvisory</styleUrl>
<Point>
<coordinates> -121.60,38.7,0 </coordinates>
</Point>
</Placemark>
</Folder>
<Folder>
<name>Special Weather Statement</name>
<Placemark>
<name>Statement</name>
<description>SPECIAL WEATHER STATEMENT NATIONAL WEATHER SERVICE
EUREKA CA 443</description>
<styleUrl>#Special Weather Statement</styleUrl>
<Point>
<coordinates>-117.13,32.82,0 </coordinates>
</Point>
</Placemark>
</Folder>
</Document>
</kml>


Thanks,
Amit

Roman N

unread,
Apr 3, 2009, 4:40:16 PM4/3/09
to KML Developer Support - Getting Started with KML
Hi Amit,

That KML is using a 24-bit color format, which is invalid according to
the KML spec. So, neither Google Earth nor Google Maps would be
expected to render that correctly. Can you try changing to 32-bit like
so:

<color>FF9933</color>

should be

<color>ffff9933</color>

and then loading the file in Google Earth and Google Maps?

- Roman

Reply all
Reply to author
Forward
0 new messages