2

I am new to coding and not too familiar with KMLs but I am trying to add an image icon overlay into an existing KML file (that contains polygon layer from shapefile) without having to overwrite the file. Previously Ive tried the "simplekml" python module which was giving me what I want but unfortunately I am not able to make the modification to an existing KML file.

All I want to do is modify the existing kml file with:

 <href>http://developers.google.com/kml/documentation/images/top_left.jpg</href>
</Icon>
<overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>
<size x="0" y="0" xunits="fraction" yunits="fraction"/>

How do I read and write into a kml file from a directory and make the modification from using this code? I am able to copy and paste the code into Google Earth but i want to be able to automate this process using python.

Browse other questions tagged or ask your own question.