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

unable to parse gx:LatLonQuad data from KML file

Sep 16, 2013 at 5:22 PM
Hello,

I am trying to parse a KML file that contains, among other things, a GroundOverlay tag with the following coordinates:

<gx:LatLonQuad>
<coordinates>-117.74237972,35.7501853118
                        -117.7436903095,35.7501853118
                        -117.7436903095,35.7491169453
                        -117.74237972,35.7491169453
</coordinates>
</gx:LatLonQuad>

When I try and use the following code to parse out the Coordinates values from the LatLonQuad tag, the query returns zero results.

KmzFile kmz = KmzFile.Open("sample.kmz");
KmlFile file = KmlFile.LoadFromKmz(kmz);
foreach (var thing in file.Root.Flatten().OfType<LatLonQuad>())
{
Console.WriteLine(thing.Coordinates.Count);
}

Looking at the SharpKml.Dom.GroundOverlay class, I don't see any support for the SharpKml.Dom.Gx.LatLonQuad class.

Can anyone help me understand how to parse out the gx:LatLonQuad coordinates from my KML file? Thanks in advance for your assistance.