ValueError:解压缩的值太多 - kml创建

时间:2014-06-05 07:05:55

标签: python kml

来自这个

lst = [[234.0, 395795.57, 6689371.9], [235.0, 
  378397.16, 6558376.17], [236.0, 389841.36, 
  6643245.34]]

kml = simplekml.Kml(open=1)

single_point = kml.newpoint(name="The World", coords=[(0.0,0.0)])

for num, lat, lon in lst:
    pnt = kml.newpoint()
    pnt.name = boreCode
    pnt.coords = [(lon, lat)]

kml.save("kml_file.kml")

错误现在显示为:AttributeError: 'float' object has no attribute 'count'当我将firstcolumn值更改为整数时,它也会将错误消息中的'float'更改为'int'

1 个答案:

答案 0 :(得分:1)

列表lst中的每个列表包含6个元素,但仅解包3.您需要具有类似

的内容
for num, lat, lon, x, y ,z in lst