Skip to content

Instantly share code, notes, and snippets.

@tdhopper
Created March 26, 2013 18:21
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tdhopper/5247816 to your computer and use it in GitHub Desktop.
Save tdhopper/5247816 to your computer and use it in GitHub Desktop.
Pandas dataframe to KML in 4 lines
import simplekml
kml = simplekml.Kml()
df.apply(lambda X: kml.newpoint(name=X["name"], coords=[( X["longitude"],X["latitude"])]) ,axis=1)
kml.save(path = "data.kml")
@gperonato
Copy link

Very useful! Do you have any idea how to apply custom styles from the DataFrame without iterating over each row?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment