Question

Recently I've been reading regards the simplekml module that python 2.7 has. So far I've found this to create a point:

import simplekml
kml = simplekml.Kml()
kml.newpoint(name="Kirstenbosch", coords=[(18.432314,-33.988862)])
kml.save("botanicalgarden.kml")

This displays the name Kirstenbosch at the coordinates listed. I've been wondering if this can be extended as it only displays the name.

For example how would I edit the code above to display on the kml screen.

Name 
Coordinates
Population 
Average age 

I've tried adding population =,average age= to the code but It won't display it only displays the name. Can extra information be displayed on the kml?? Can anyone show me how to display the below list on the kml screen in google earth for the following as an example??

['Kirstenbosch',18.432314,-33.988862, 150000, 32]

Which correlates to name coordinates population and average age

No correct solution

OTHER TIPS

Google's description suggests that a placemark can have:

a description that appears in the "balloon" attached to the Placemark.

a name

a point

You can add this information in python using

pnt = kml.newpoint(name="Kirstenbosch", coords=[(18.432314,-33.988862)])
pnt.description = 'population: 150000 age: 32'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top