Created
June 18, 2020 06:43
-
-
Save ivder/6f7fdf0abf28e4f60e53727c0cd4ebf3 to your computer and use it in GitHub Desktop.
kml converter for coordinate list in 1 file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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