Polygon disappears when zoomed in.

1,477 views
Skip to first unread message

therocket18

unread,
Feb 17, 2009, 4:39:20 PM2/17/09
to KML Developer Support - Google Earth Plug-in
I've searched and tried a ton of different coding to resolve this
problem, alas I end up Posting a question to the Pros.

So, I had a shapefile that I exported to kml with the MapWindow
Shape2Earth tool.
Got the kml extracted, and it displayed on the website all was well.

The KML contains 1 Placemark with a bunch of Polygons.

However when I zoom in on the map (GE API), some/most of the Polygons
disappear.

This seems to be dependant on the <outerBoundaryIs> setting.

Example: The last polygon coded has a outerboundary setting.
If I move or zoom into the map so that this last polygon is off screen
the rest of the polygons disappear.
I have saved an example of the disappearing polygon at

http://ittraffic.ca/1001.htm

you can see that there are 2 blue polygons
when you pan to a point where the lower polygon is off screen the top
poly disappears?



So I then added another polygon to the kml that outlined all of the
polygons within the Placemark, and applied outerboundaryis to it.

Now the polygons don't disappear when you zoom in. - Great except I
now have the outside polygon showing still, and wanted I to hide it
somehow.

http://ittraffic.ca/1002.htm

you can see that there are now 3 polygons, and now panning within this
third polygon prevents the inner 2 polygons from disappearing.


The result I wish to have is either to have the 2 polys remain
viewable when zooming moving the map, or to have the 3 polys with the
outerboundary outline poly hidden.

Any help would be appreciated, this is my 3rd day trying to resolve
this issue.
Richard.





therocket18

unread,
Feb 17, 2009, 4:44:37 PM2/17/09
to KML Developer Support - Google Earth Plug-in
The kmls files are viewable at
http://ittraffic.ca/KML_Files/static/kml1.kml - just 2 polys

http://ittraffic.ca/KML_Files/static/kml2.kml - 3rd outline poly
included.

therocket18

unread,
Feb 17, 2009, 7:08:07 PM2/17/09
to KML Developer Support - Google Earth Plug-in
Got the answer with the use of the region syntax which defines the
area where Placemarks are loaded within the screen.


<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name>LOD_Example</name>
<open>1</open>
<Region>
<LatLonAltBox>
<north>50.99904863786898</north>
<south>47.41943359375</south>
<east>-122.080078125</east>
<west>-128.999270146562</west>
<minAltitude>0</minAltitude>
<maxAltitude>0</maxAltitude>
</LatLonAltBox>
<Lod>
<minLodPixels>128</minLodPixels>
<maxLodPixels>-1</maxLodPixels>
<minFadeExtent>0</minFadeExtent>
<maxFadeExtent>0</maxFadeExtent>
</Lod>
</Region>
<Style id="hi">
<LineStyle>
<color>fffc5804</color>
</LineStyle>
<PolyStyle>
<color>ff89b498</color>
<fill>0</fill>
</PolyStyle>
</Style>
<Placemark id="0">
<snippet></snippet>
<Snippet maxLines="0"></Snippet>
<styleUrl>#hi</styleUrl>
<Polygon>
<extrude>1</extrude>
<tessellate>1</tessellate>
<outerBoundaryIs>
<LinearRing>
<coordinates>

</coordinates>
</LinearRing>
</outerBoundaryIs>
<innerBoundaryIs>
<LinearRing>
<coordinates>
</coordinates>

</LinearRing>
</innerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>

That fixed it, sorry for the trouble......... hope this helps someone.

http://code.google.com/apis/kml/documentation/kmlreference.html#region
http://geochalkboard.wordpress.com/2008/01/14/using-kml-regions-to-display-large-gis-datasets-in-google-earth-part-1/

Reply all
Reply to author
Forward
0 new messages