Is there a simple way to combine KML files into one KML file with Python?
Nothing complex, I just want to append them to each other.
Why I want it to be a script:
Some people in our company create KML files of work site boundaries to display in Google Earth. The idea is to make these all accessible to everyone – my thought is that when a staff member creates a new KML, they can add it to a specific folder on the server. The script will run nightly to combine them, and all staff will have a network link in Google Earth to the folder – thus, they daily get new information in Google Earth.
This was a staff request, so I'm looking into it.
I installed the pyKML library with pip (latest version), but when I try to import it (in Atom with the Script package), I get the following error: ModuleNotFoundError: No module named 'pyKML'
Path appears to be correct.
Can anyone provide assistance with pyKML or an alternate solution?
Best Answer
You can use the fastkml python lib for this. It can be found at https://fastkml.readthedocs.io/en/latest/ with all instructions to the usage.
Here is a code example for using this library to generate a kml structure.