This project has moved and is read-only. For the latest updates, please go here.

LatLonAltBox in GroundOverlay

Jun 17, 2015 at 8:17 PM
Hello,

I am using Visual Studio and VB.NET to process KML files and I am having some trouble getting the LatLonAltBox information under GroundOverlay. This is what my KML file looks like:
<GroundOverlay>
   <LatLonAltBox>
        <north>20.25</north>
        <south>25.35</south>
        <east>100.56</east>
        <west>98.34</west>
   </LatLonAltBox>
</GroundOverlay>
I am using the following code:
kmlData = KmlFile.Load(data)

For Each go In kmlData.Root.Flatten().OfType(Of SharpKml.Dom.GroundOverlay)()

     For Each coordBox In go.Flatten().OfType(Of SharpKml.Dom.LatLonAltBox)()

          /// DO STUFF HERE

     Next

Next
I can never get into the 2nd for loop since it cannot find any LatLonAltBox. I further tried debugging it in Visual Studio and it seems that the LatLonAltBox information is under the protected Orphans property when I examine the GroundOverlay object.

How can I access the LatLonAltBox information?

Thanks.
Jun 18, 2015 at 6:20 AM
Looking at the GroundOverlay documentation and it's expecting a LatLonBox as a child, not a LatLonBoxAlt so I don't think the KML is valid, hence why they're appearing in the Orphans.

If you control the generated KML and need to use the LatLonBoxAlt then I think you should be able to use the Region element.

Hope it helps,
Sam