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.

closed as off-topic by PolyGeo Oct 31 '16 at 10:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.