李旭分享 http://blog.sciencenet.cn/u/lixujeremy 代码与散打爱好者!

博文

Python+xlrd: Create a Point Shapefile based on Lon/Lat

已有 3187 次阅读 2015-3-15 22:30 |个人分类:Python|系统分类:科研笔记| EXCEL, shapefile

已知:Excel文件sheet表中包含气象站点的温度、降水数据,并附上站点的经度与纬度,试探讨如何将该数据生成Point Shapefile文件,并为各个Point添加属性字段及赋值?

方法:Python+xlrd读取Excel文件中的sheet内容,Python+Arcpy实现Point Shapefile文件创建及其字段添加及赋值环节。

认真体会CopyFeatures_managementAddField_managementUpdateCursor

附上测试数据及代码(xl2shp.rar, Updated by LI Xu on 2 May, 2015)。运行结果如图 1红框表示添加字段及赋值后的属性表。

1




https://wap.sciencenet.cn/blog-1148346-874665.html

上一篇:Matlab:One Picture insert to The other
下一篇:Python+Arcpy: Interpolating Using IDW
收藏 IP: 202.112.90.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-3 21:39

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部