I am trying to extract polygons from labels in a KML file. So far so good:
Imports <xmlns:g='http://earth.google.com/kml/2.0'>
Imports System.Xml.Linq
Partial Class Test_ImportPolygons
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Kml As XDocument = XDocument.Load(Server.MapPath("../kmlimport/ga.kml"))
For Each Placemark As XElement In Kml.<g:Document>.<g:Folder>.<g:Placemark>
Dim Name As String = Placemark.<g:name>.Value
...
Next
End Sub
End Class
I would like to grab the whole block <polygon>...</polygon>as a string. I tried something like this (where ... above):
Dim Polygon as String = Placemark.<g:Polygon>.InnerText
but the XElement object does not have an InnerText property or any equivalent as far as I can tell. How can I capture the raw XML that defines the XElement?
source
share