fma*_*ark 5 python gis excel shapefile
我有一个excel电子表格,我想以编程方式转换为ESRI shapefile.它包含两列中的X和Y坐标,以及其他列中的各种属性数据.电子表格采用excel 97格式(即不是.xlsx).
我希望能够将其转换为点几何shapefile,每行的x,y对代表一个点.理想情况下,我希望第三列指定x,y坐标对的坐标系,并使excel文件包含异构坐标系.
如何以编程方式将此Excel电子表格(.xls)转换为shapefile?优选地在Python中,但是将接受其他实现.
这样的事情?
import xlrd
book = xlrd_open_workbook("data.xls") 
sheet = book.sheet_by_index(0)  
data = [] #make a data store
for i in xrange(sheet.nrows):
  row = sheet.row_values(i)
  x=row[0]
  y=row[1]
  data.append(x,y)
import point_store
point_store.save('points-shifted.shp', [data], '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')
| 归档时间: | 
 | 
| 查看次数: | 10519 次 | 
| 最近记录: |