|
5鱼币
这是代码:
- # coding:utf-8
- import shapefile
- w = shapefile.Writer(shapefile.POINT)
- w.autoBalance = 1
- w.field('x', 'C')
- w.field('y', 'C', '40')
- w.field('v', 'C', '40')
- w.point(116, 6, 6)
- w.record(116, 6, 6)
- w.save('point.shp')
复制代码
下面是报错:
- Traceback (most recent call last):
- File "D:/PythonProjects/mobai/debug/test_pyshp.py", line 10, in <module>
- w = shapefile.Writer(shapefile.POINT)
- File "D:\Anaconda3\lib\site-packages\shapefile.py", line 1057, in __init__
- self.shp = self.__getFileObj(os.path.splitext(target)[0] + '.shp')
- File "D:\Anaconda3\lib\ntpath.py", line 202, in splitext
- p = os.fspath(p)
- TypeError: expected str, bytes or os.PathLike object, not int
复制代码
请各位大佬帮我看一下,代码思路就是利用pyshp库完成一个shape文件的写入和保存工作。拜托
可能是等式[]和‘ ’有更新所以w=。。。。不成例
|
最佳答案
查看完整内容
可能是等式[]和‘ ’有更新所以w=。。。。不成例
|