2 Star 4 Fork 3

汉塞大叔/Geospatial_Analysis_By_Python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
1.2 读取几何图形.py 553 Bytes
一键复制 编辑 原始数据 按行查看 历史
汉塞大叔 提交于 2021-01-20 19:53 +08:00 . 上传 py
import shapefile
# 1. shp 内所有点的集合
r = shapefile.Reader("shapefiles/NYC_MUSEUMS/NYC_MUSEUMS_GEO")
shapes = r.shapes()
for item in shapes:
print(item)
# 2.多有图形的数量
print(len(shapes))
# 3.取出集合内第7个图形
print(r.shape(3))
# 4.图形所包含的属性
for name in dir(shapes[3]):
if not name.startswith('_'):
print(name)
# 5.打印图形类型的代号和类型
print(shapes[3].shapeType)
print(shapes[3].shapeTypeName)
# 6.打印点的坐标
print(shapes[3].points)
r.close()
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

搜索帮助