Skip to content

Instantly share code, notes, and snippets.

@ivder
Created June 18, 2020 06:43
Show Gist options
  • Save ivder/6f7fdf0abf28e4f60e53727c0cd4ebf3 to your computer and use it in GitHub Desktop.
Save ivder/6f7fdf0abf28e4f60e53727c0cd4ebf3 to your computer and use it in GitHub Desktop.
kml converter for coordinate list in 1 file
# -*- coding: utf-8 -*-
import simplekml
import os
from itertools import islice
def kml_converter(inputfile,kml):
f = open(inputfile,"r")
for row in islice(f,1,None): #skip read header
data=row.split(",")
print(unicode(data[2], "utf-8"), data[5], data[6])
kml.newpoint(name=unicode(data[2], "utf-8"), coords=[(data[6],data[5])]) #branchname = 한글
f.close()
#main
kml=simplekml.Kml()
inputfile="C:\\DeepEye\\PHTB_Branch.csv"
kml_converter(inputfile,kml)
kml.save('branch.kml')
kml=None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment