iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >python 处理arcgis gdb文
  • 114
分享到

python 处理arcgis gdb文

pythonarcgisgdb 2023-01-31 01:01:36 114人浏览 泡泡鱼

Python 官方文档:入门教程 => 点击学习

摘要

import arcpyfrom arcpy import envimport osimport typesfc = 'D:/demo.gdb/test'  # file location .fields = ["Id", "name",

import arcpy
from arcpy import env
import os
import types
fc = 'D:/demo.gdb/test'  # file location .
fields = ["Id", "name", "descr"] # you table columuns .
print '+++++++++++++++++++++++++++++'
with arcpy.da.SearchCursor(fc, fields) as cursor:
 f = file('D:/demo.txt', 'w') # open for 'w'riting
 for row in cursor:
     str = "{0}, {1}, {2}".fORMat(row[0], row[1], row[2])
     #print("{0}, {1}, {2}".format(row[0], row[1], row[2]))
     print 'The contents is :',str
     f.write(str) # write text to file
     f.write('\n');
 # close the file   
 f.close()
 
 
#print out the content of this text.
f = file('D:/demo.txt')
# if no mode is specified, 'r'ead mode is assumed by default
while True:
    line = f.readline()
    if len(line) == 0: # Zero length indicates EOF
        break
    print line,
    # Notice comma to avoid automatic newline added by python
f.close() # close the file


    
    
     

--结束END--

本文标题: python 处理arcgis gdb文

本文链接: https://www.lsjlt.com/news/183872.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作