I am running into a roadblock where I need to somehow export the data from a points KMZ/KML file into a tabular format where all fields in the dataset are accessible. So far, I have only had minor luck in using the KML to Layer tool to get a feature class with all the geometry appropriately visible, but the attribute table shows that all the original attribute data is shoved into one field called "PopupInfo" and formatted as XML.
I have seen other threads where they mention that Data Interoperability may be the best solution to fully export all KMZ/KML fields into a tabular format with all original fields present, but I was wondering if anyone in the community has ever gone through this workflow.
I do not have access to the original file that the KMZ was created from (at least, not yet) so for now, I am stuck.
My end goal is to be able to get all the data into a table where I can then append additional data and create a new dataset from it.
Any help is greatly appreciated.
The trouble with KML is what appears like a table in most viewers can be different things under the covers, like HTML or XML documents, and you have to handle them differently with Data Interoperability. I have seen scripted approaches too. If you are really lucky the elements will have a schema document alongside them, but in my experience only if written with Data Interoperability or FME. It will be data dependent. I can take a look if you can share a file.
Thanks for the reply Bruce Harold. Unfortunately I cannot share the file as it contains sensitive information. When you say "the elements will have a schema document alongside them," what would that look like? The only reference to schema when looking at the file in Notepad is in the first few elements within a "Document id" tag. I don't assume that is it?
Either way, it sounds like Data Interop is a long-shot solution?
Do you think the best way to get this done is with a third party tool or a script?
Hi, a schema element is in the attached KML file, its the only way to preserve what data type each attribute is.
Data Interoperability will be able to extract your data (even if resorting to default text data types) but you do have to learn to drive it.
if you can script a little then going via OGR is an option:
Example calling OGR:
Unfortunately we don't ship the KML drivers in the core Pro python distribution but if you install GDAL from a conda distribution you'll add it, or outside of scripting download GDAL and use ogr2ogr command line.