2 Star 4 Fork 3

汉塞大叔/Geospatial_Analysis_By_Python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
3.1 具有测量(M)值的Shapefile.py 606 Bytes
一键复制 编辑 原始数据 按行查看 历史
汉塞大叔 提交于 2021-01-20 19:53 +08:00 . 上传 py
import shapefile
# 1.创建具有测量(M)值的Shapefile
w = shapefile.Writer('shapefiles/test/linem')
w.field('name', 'C')
w.linem([ # 3.2 为 w.linez(....)
[[1, 5, 0], [5, 5], [5, 1, 3], [3, 3, None], [1, 1, 0]], # line with one omitted and one missing M-value
[[3, 2], [2, 6]] # line without any M-values
])
w.record('linem1')
w.close()
# 2.读取Shapefile的M值
r = shapefile.Reader('shapefiles/test/linem') # the lower and upper bound of M-values in the shapefile
print(r)
print(r.bbox)
print(r.mbox)
print(r.shape())
print(r.shape(0))
print(r.shape(0).m)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/fengfeng233/geospatial_-analysis_-by_-python.git
git@gitee.com:fengfeng233/geospatial_-analysis_-by_-python.git
fengfeng233
geospatial_-analysis_-by_-python
Geospatial_Analysis_By_Python
master

搜索帮助