ranathunga / kml-samples

Automatically exported from code.google.com/p/kml-samples
0 stars 0 forks source link

Polygon outline is pixelated if polygon is also filled #376

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Which products are affected?
Google Earth all versions

What steps will reproduce the problem?
1. "Add" a polgyon to Google Earth.
2. Set the "Line" color to Red, and the width to 2.0
3. Set the "Area" to "Outlined"
4. Observe that the outline is a crisp red line
5. Set the "Area" to "Filled + Outlined".
6. Optionally set the "Area" opacity to 0%
7. Observe that the outline is jagged.  It is not crisp as it was when the area 
was "filled"
8. Additionally, set the "Area" to "Filled".
9. Observer that the edges of the polygon are jagged.

What is the expected output or behavior? What do you see instead?
1. If Area is Outlined, the border should be a crisp line.  This behavior is 
working.
2. If Area is Filled + Outlined, the border should be the same crisp line and 
the remainder of the polygon should be filled.
3. If the Area is Filled, the fill color should extend all the way to the edge 
of the polygon, and the edge should be crisp (that is, if there is no 
"outline", then the "fill" should extend into the region that would otherwise 
be covered by the outline)

What application versions (if any) are you using?
All versions

Which operating systems (and/or relevant web browsers) are affected?
Windows, not tested on others

Please provide any additional information (code snippets/links) below.
This code produces a smooth border.  This is the expected behaviour.

fill is set to 1
outline is set to 0
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" 
xmlns:gx="http://www.google.com/kml/ext/2.2" 
xmlns:kml="http://www.opengis.net/kml/2.2" 
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
    <name>KmlFile</name>
    <Placemark>
        <name>Crisp Border, outlined only</name>
        <Style>
            <LineStyle>
                <color>ff0000ff</color>
                <width>2</width>
            </LineStyle>
            <PolyStyle>
                <outline>1</outline>
                <fill>0</fill>
                <color>00ffffff</color>
            </PolyStyle>
        </Style>

        <Polygon>
            <tessellate>1</tessellate>
            <outerBoundaryIs>
                <LinearRing>
                    <coordinates>
                        -100,41,0 -102,38,0 -96,37,0 -96,41,0 -100,41,0 
                    </coordinates>
                </LinearRing>
            </outerBoundaryIs>
        </Polygon>
    </Placemark>
</Document>
</kml>

This code produces a jagged border.  Expected behaviour is that the border 
should be just as crisp as if the polygon is not filled.
outline is set to 1
fill is set to 1
fill opacity is 0

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" 
xmlns:gx="http://www.google.com/kml/ext/2.2" 
xmlns:kml="http://www.opengis.net/kml/2.2" 
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
    <name>KmlFile</name>
    <Placemark>
        <name>Jagged Border, transparent fill</name>
        <Style>
            <LineStyle>
                <color>ff0000ff</color>
                <width>2</width>
            </LineStyle>
            <PolyStyle>
                <outline>1</outline>
                <fill>1</fill>
                <color>00ffffff</color>
            </PolyStyle>
        </Style>

        <Polygon>
            <tessellate>1</tessellate>
            <outerBoundaryIs>
                <LinearRing>
                    <coordinates>
                        -100,41,0 -102,38,0 -96,37,0 -96,41,0 -100,41,0 
                    </coordinates>
                </LinearRing>
            </outerBoundaryIs>
        </Polygon>
    </Placemark>
</Document>
</kml>

This code produces a jagged edge.  Expected behaviour is that the fill should 
extend all the way to the edge, and that the edge should be crisp and smooth.
outline is set to 0
fill is set to 1
fill opacity is 100

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" 
xmlns:gx="http://www.google.com/kml/ext/2.2" 
xmlns:kml="http://www.opengis.net/kml/2.2" 
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
    <name>KmlFile</name>
    <Placemark>
        <name>Jagged Border, transparent fill</name>
        <Style>
            <LineStyle>
                <color>ff0000ff</color>
                <width>2</width>
            </LineStyle>
            <PolyStyle>
                <outline>0</outline>
                <fill>1</fill>
                <color>ffffffff</color>
            </PolyStyle>
        </Style>

        <Polygon>
            <tessellate>1</tessellate>
            <outerBoundaryIs>
                <LinearRing>
                    <coordinates>
                        -100,41,0 -102,38,0 -96,37,0 -96,41,0 -100,41,0 
                    </coordinates>
                </LinearRing>
            </outerBoundaryIs>
        </Polygon>
    </Placemark>
</Document>
</kml>

Original issue reported on code.google.com by bill.cl...@earthpoint.us on 28 Feb 2011 at 4:58

GoogleCodeExporter commented 9 years ago
I am still experiencing this on GE 6.2.0.5905 (Windows 7 Professional) and I 
have found no suitable workaround.  

Original comment by rafael.l...@gmail.com on 12 Mar 2012 at 5:55

GoogleCodeExporter commented 9 years ago
I am also experiencing this problem. My current workaround is to create an 
identical copy of my polygon and set one to "Outlined" and set the other to 
"Filled". This gets me the result I want, albeit in a cumbersome way.

Original comment by ryan.jam...@gmail.com on 29 Aug 2012 at 11:00

Attachments:

GoogleCodeExporter commented 9 years ago
The problem is present again in the latest updates from March of this year 
(2013).

If the polygon is filled, the outline is totally pixelated. The pixelation is 
worse if the viewing angle is far from the zenith.

If the polygon is not filled, the outline is perfect.

I've attached two screenshots of the same polygons with and without filling.

Please it's a very big problem because it makes totally unusable the polygons 
at low altitudes.

Thank you in advance

Original comment by andrew.f...@gmail.com on 16 May 2013 at 1:56

Attachments:

GoogleCodeExporter commented 9 years ago
I too am having this problem and desperately need a solution. I am using 
windows 7 and the google earth version I have is 7.1.1.1888. Any assistance 
would be much appreciated!

Cheers,
Jess

Original comment by Jess.Cap...@gmail.com on 29 Apr 2014 at 2:25