<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Extracting attributes from KML descriptions in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/646610#M36584</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the easiest way, I have discovered and prepared a video (link below);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All Attributes Conversion, Google Earth (KML or KMZ) to Shapefile&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/_e_besxeAlY"&gt;https://youtu.be/_e_besxeAlY&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Khalid Mahmood&lt;/P&gt;&lt;P&gt;GIS Expert since 2008&lt;/P&gt;&lt;P&gt;kmc786pak@gmail.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Aug 2019 11:35:31 GMT</pubDate>
    <dc:creator>KhalidMahmood</dc:creator>
    <dc:date>2019-08-02T11:35:31Z</dc:date>
    <item>
      <title>Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/646608#M36582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am regularly asked how to extract the tabular data visible in KML description balloons in ArcGIS Earth into properly typed attributes that can be written to a Geodatabase feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While KML does support a schema object that Data Interoperabilty's Quick Import geoprocessing tool would see and honour, often KML files are received that contain only HTML data in description objects, and the data is frustratingly close but inaccessible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Interoperability is still the answer, but you need to author a Spatial ETL tool tailored to your data.&amp;nbsp; First, inspect the KML features in Earth and decide what attributes you want and what data type they are.&amp;nbsp; Unfortunately there is no magic wand to wave to help with this, the data is untyped in the KML description and you need to do this clerical review.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually only one Placemark geometry type is of interest, but if you need to convert multiple Placemark geometry types repeat the review for each one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then author a Spatial ETL tool with KML Reader and Geodatabase Writer, manually specifying each output feature class' geometry and attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data workflow between the Reader and Writer is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://knowledge.safe.com/articles/19918/how-to-expose-feature-attributes-from-kml-tag.html" title="https://knowledge.safe.com/articles/19918/how-to-expose-feature-attributes-from-kml-tag.html"&gt;How to expose feature attributes from KML tag - FME Knowledge Center&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may need a GeometryFilter transformer after the Reader to filter Placemarks of interest, and if handling date fields, a DateFormatter to make the values writable to Geodatabase (say %x input, FME date output).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attributes you expose will then be written as properly typed fields in a Geodatabase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a related workflow to extract attributes from extended data - if anyone needs this message me in GeoNet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Mar 2017 17:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/646608#M36582</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2017-03-03T17:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/646609#M36583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been able to make this work using cursors and lists to split the PopupInfo xml field into useful values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;1. use the arcpy KML to layer tool and Project tools to&amp;nbsp;get into to the desired coordinate system (i ran into problems adding fields to the original conversion output, which may be due to the layer file associated with it)&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;2.&amp;nbsp;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Use .da.SearchCursor to get the PopupInfo string from the first row. Then split it into a list based on '&amp;lt;', delete the first two values (the label field from Google Earth) and put remaining values that have the 'td&amp;gt;' tag but not the 'td&amp;gt;' closing tag into a new list of field names (even indexes) and field values (odd indexes)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; padding: 0px 0px 0px 30px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;3. Loop through field names list with arcpy.AddField_management to add all fields (skip if they already exist)&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;4. Use .da.UpdateCursor&amp;nbsp;to get PopupInfo's for all rows,&amp;nbsp;then split and create new lists just like with&amp;nbsp;search cursor&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;5. this time, use all the odd index values to update rows (&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&lt;EM&gt;if i%2 &amp;lt;&amp;gt; 0: row[(i-1)/2] = list&lt;I&gt;&lt;/I&gt;&lt;/EM&gt;&lt;I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;) and then cursor.updateRow(row)&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; padding: 0px 0px 0px 30px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Dylan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 20:55:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/646609#M36583</guid>
      <dc:creator>DylanWarburg2</dc:creator>
      <dc:date>2017-11-09T20:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/646610#M36584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the easiest way, I have discovered and prepared a video (link below);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All Attributes Conversion, Google Earth (KML or KMZ) to Shapefile&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/_e_besxeAlY"&gt;https://youtu.be/_e_besxeAlY&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Khalid Mahmood&lt;/P&gt;&lt;P&gt;GIS Expert since 2008&lt;/P&gt;&lt;P&gt;kmc786pak@gmail.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2019 11:35:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/646610#M36584</guid>
      <dc:creator>KhalidMahmood</dc:creator>
      <dc:date>2019-08-02T11:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/646611#M36585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dylan, This is an extremely helpful script! Thank you for sharing with everyone else.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 18:06:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/646611#M36585</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-09-20T18:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1210169#M44226</link>
      <description>&lt;P&gt;Easiest way to do this is to open the KML is QGIS and export it as a shp.,&amp;nbsp; The attributes will be added to the table in the output.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 23:42:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1210169#M44226</guid>
      <dc:creator>CourtneyWatson</dc:creator>
      <dc:date>2022-09-06T23:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1341955#M44753</link>
      <description>&lt;P&gt;Hey All.&lt;BR /&gt;I stumbled on this and a few other threads after running into the same problem. I ended up making a python script with chatGPT that uses the "beautifulsoup" package (which i found was already installed in my instance) to scrape the HTML table from the layer attribute, in my case "Popupinfo", and creates a column for each row in the table. I then created a tool in arcgis using the script to make it easier to repeat this process. The tool/script takes two inputs, the layer name, and then a dropdown for the attribute that's holding the html table. The rest is magic. Here's the code I used in case anyone still has a need.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I forgot to mention, I first used the KML to layer tool in AGP to convert the KML to a feature layer, then ran this tool on the newly created layer. Also, some caveats, I was getting an error about fields not starting with a number. I had no need for those rows throwing an error so I had the script skip those. I also had to remove spaces for the same reason.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps someone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 14:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1341955#M44753</guid>
      <dc:creator>DavidBranca</dc:creator>
      <dc:date>2023-10-26T14:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1347347#M44772</link>
      <description>&lt;P&gt;Worked like a charm. Of course adding dozens of fields individually takes a bit of time. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 19:42:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1347347#M44772</guid>
      <dc:creator>DavinShokes1</dc:creator>
      <dc:date>2023-11-08T19:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1512609#M45294</link>
      <description>&lt;P&gt;For whatever reason, I wasn't able to make this work as a standalone script or as a custom geoprocessing tool. Lots of errors and ultimately it just gave me null values for every new field from the HTML popupinfo. I tried using Copilot to debug but no luck.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 20:22:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1512609#M45294</guid>
      <dc:creator>MereFyfe</dc:creator>
      <dc:date>2024-07-30T20:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1512949#M45300</link>
      <description>&lt;P&gt;Did you check to make sure the 'beautifulsoup' package was installed first?&lt;/P&gt;&lt;P&gt;Did you catch the piece where I converted the KML to a layer first?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also i did this with ArcGIS Pro 3.x (unsure what the minor revision was at the time) in case that makes a difference in your case.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 14:18:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1512949#M45300</guid>
      <dc:creator>DavidBranca</dc:creator>
      <dc:date>2024-07-31T14:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting attributes from KML descriptions</title>
      <link>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1567432#M45513</link>
      <description>&lt;P&gt;Yes, this seems to work. It puts the fields in random order it seems but it works. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 18:47:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extracting-attributes-from-kml-descriptions/m-p/1567432#M45513</guid>
      <dc:creator>MattStarryACE</dc:creator>
      <dc:date>2024-12-11T18:47:13Z</dc:date>
    </item>
  </channel>
</rss>

