Search code examples
kmlgoogle-earth

Changing map styles in google earth


I'm adding a chloropleth US county map in Google Earth. I've made the map in qgis and exported as a KML, but the county borders become extremely thick when I open it in Google Earth. When I try to change it, it makes all of the borders and the county values uniform, and takes away the chloropleth. How can I change individual styles such as borders in Google Earth?

Here is a representative KML:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <Document>
        <name>geo_county_ma</name>
        <Style id="style3">
            <LineStyle>
                <color>40000000</color>
                <width>3</width>
            </LineStyle>
            <PolyStyle>
                <color>ffe7d1af</color>
            </PolyStyle>
        </Style>
        <Style id="style2">
            <LineStyle>
                <color>40000000</color>
                <width>3</width>
            </LineStyle>
            <PolyStyle>
                <color>fff4e6d7</color>
            </PolyStyle>
        </Style>

        <Placemark>
            <styleUrl>#style3</styleUrl>
            <Polygon>
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>
                        -122.4361217223626,37.80089762963801 -122.431353047545,37.80152776851571 -122.4317440301943,37.80336276723568 -122.436466590289,37.80271696430888 -122.4361217223626,37.80089762963801 
                    </coordinates>
                    </LinearRing>
                </outerBoundaryIs>
            </Polygon>
        </Placemark>

        <Placemark>
            <styleUrl>#style2</styleUrl>
            <Polygon>
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>
                -122.436124895585,37.80088925120538 -122.4313590833908,37.80150407165125 -122.4310083235047,37.79963224033016 -122.435667004224,37.79900507682146 -122.436124895585,37.80088925120538
            </coordinates>
                    </LinearRing>
                </outerBoundaryIs>
            </Polygon>
        </Placemark>
    </Document>
</kml>

Solution

  • If the lines/borders of polygons are too thick try changing the width value for LineStyle to 1 (or 2) whichever works best visually:

            <LineStyle>
                <color>40000000</color>
                <width>1</width>
            </LineStyle>
    

    You can right-mouse click on each Placemark and manually change the style line width in Google Earth but suggest you change the KML in a text editor and globally replace <width>3</width> with <width>1</width>.