Python实现Table To Point代码 分类: Python 2015-07-31 18:45 3人阅读 评论(0) 收藏
</pre><pre name="code" class="python"><span style="font-family:KaiTi_GB2312;font-size:18px;color:#000099;"><span style="white-space:pre"> </span>ArcGIS中提供了XY To Point的工具,但是在ArcToolBox里并没有提供根据Table中的XY坐标转换为Point的工具,不利于GP工具的调用,共享一下。</span>
</pre><pre name="code" class="python">
<span style="color: rgb(0, 0, 153); font-family: KaiTi_GB2312;font-size:18px;">-------------------------------------</span>
"""
Create Point Feature Class from Table
""" ################### Imports ########################
import arcpy as ARCPY
import arcpy.management as DM
import arcpy.da as DA
import ErrorUtils as ERROR
import os as OS
import locale as LOCALE
LOCALE.setlocale(LOCALE.LC_ALL, '') ################ Output Field Names #################
fieldList = ["XCoord", "YCoord"] ################### GUI Interface ###################
def TableToPoints():
"""A Table that is include xy coordinates is used to make some points.""" #get user provided inputs and outputs
inTable = ARCPY.GetParameterAsText(0)
outputFC = ARCPY.GetParameterAsText(1) # define a empty points feature object
point = ARCPY.Point() # A list to hold the pointGeometry objects
pointList = [] # for each coordinate pair,populate the point object and create a new pointgeometry
with DA.SearchCursor(inTable, fieldList) as cursors:
for row in cursors:
point.X = row[0]
point.Y = row[1]
pointGeometry = ARCPY.PointGeometry(point)
pointList.append(pointGeometry) # create copy of the pointGeometry objects,by using pointgeometrylist as input to the copyfeatures tool
ARCPY.CopyFeatures_management(pointList, outputFC) if __name__ == "__main__":
TableToPoints()
--------------------欢迎来访,拒绝转载---------------------
版权声明:本文为博主原创文章,未经博主允许不得转载。
Python实现Table To Point代码 分类: Python 2015-07-31 18:45 3人阅读 评论(0) 收藏的更多相关文章
- 链表中用标兵结点简化代码 分类: c/c++ 2014-09-29 23:10 475人阅读 评论(0) 收藏
标兵结点(头结点)是在链表中的第一个结点,不存放数据,仅仅是个标记 利用标兵结点可以简化代码.下面实现双向链表中的按值删除元素的函数,分别实现 带标兵结点和不带标兵结点两版本,对比可见标兵结点的好处. ...
- 网站通用登录模块代码 分类: ASP.NET 2014-12-06 10:49 615人阅读 评论(0) 收藏
1.HTML部分: <form id="form1" runat="server"> <script src=".. ...
- Rebuild my Ubuntu 分类: ubuntu shell 2014-11-08 18:23 193人阅读 评论(0) 收藏
全盘格式化,重装了Ubuntu和Windows,记录一下重新配置Ubuntu过程. //build-essential sudo apt-get install build-essential sud ...
- [leetcode] Reverse Linked List 分类: leetcode 算法 2015-07-09 18:44 2人阅读 评论(0) 收藏
反转链表:比较简单的问题,可以遍历也可以递归. # Definition for singly-linked list. class ListNode: def __init__(self, x): ...
- Ubuntu vim+ ctags(包含系统函数) + taglist 配置 分类: vim ubuntu 2015-06-09 18:19 195人阅读 评论(0) 收藏
阅读大型代码,我们经常需要打开很多的代码文件,搜索各种定义.windows下用惯了ide的朋友,转战Linux的时候可能会觉得很难受,找不到合适的阅读工具.其实万能的vim就可以实现.下面介绍一下vi ...
- Pots 分类: 搜索 POJ 2015-08-09 18:38 3人阅读 评论(0) 收藏
Pots Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11885 Accepted: 5025 Special Judge D ...
- The Happy Worm 分类: POJ 排序 2015-08-03 18:57 5人阅读 评论(0) 收藏
The Happy Worm Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 4698 Accepted: 1047 Descr ...
- 树莓派(raspberry)启用root账户 分类: 服务器搭建 Raspberry Pi 2015-04-12 18:45 95人阅读 评论(0) 收藏
树莓派使用的linux是debian系统,所以树莓派启用root和debian是相同的. debian里root账户默认没有密码,但账户锁定. 当需要root权限时,由默认账户经由sudo执行,Ras ...
- mount命令以及mount ntfs硬盘权限权限与显示的问题 分类: shell ubuntu 2014-11-08 18:29 148人阅读 评论(0) 收藏
sudo mount -t 文件系统类型 -o 可设置选项 设备路经 访问路经 #常用文件类型如下: iso9660 光驱文件系统, vfat fat/fat32分区, ntfs ntfs分区, sm ...
随机推荐
- e643. 以匿名类处理事件
If an event handler is specific to a component (that is, not shared by other components), there is n ...
- linux -- ubuntu搭建nodejs环境
需求:在web端做一个实时性功能比较强的模块, 客户端:用websocket 服务端:node.js node.js介绍:node.js天生就是一个高效的服务端语言,可以直接使用 javascript ...
- Android ListView使用BaseAdapter与ListView的优化 (转至 http://www.open-open.com/lib/view/open1339485728006.html)
在ListView的使用中,有时候还需要在里面加入按钮等控件,实现单独的操作.也就是说,这个ListView不再只是展示数据,也不仅仅是这一行要来处理用户的操作,而是里面的控件要获得用户的焦点.读者可 ...
- GC之二--GC是如何回收时的判断依据、shallow(浅) size、retained(保留) size、Deep(深)size
回到问题“为何会内存溢出?”. 要回答这个问题又要引出另外一个话题,既什么样的对象GC才会回收? 一.对象存活方式判断方法 在上一篇文章<GC之一--GC 的算法分析.垃圾收集器.内存分配策略介 ...
- window用Xmanager4.0的Xstart连接linux远程桌面
安装包: xorg-x11-xauth xterm.x86_64 0:253-1.el6 Execute command path:/usr/bin/xterm Xstart连接Linux远程桌面有一 ...
- 【Mongo】数据备份与还原
http://blog.51yip.com/nosql/1573.html mongorestore -d 数据库名 -c 集合名 --drop **.bson
- C# Asp.net 制作一个windows服务
那下面就来说说如何制作一个服务来 实现开机自动启动,每隔一段时间向student表中插入数据. 步骤: 1) 新建项目 ---> Windows 服务 2) 拖放Times控件 工具箱中 ...
- Ubuntu 12.04.3 X64 使用 NFS 作为文件共享存储方式 安装 Oracle11g RAC
nfs-server 在 Ubuntu上可以选择 : nfs-kernel-server:如果在windows上,可以选择:haneWIN NFS Server nfs-client Ubuntu上使 ...
- datatables隐藏列排序
var tableOption = { id: 'cacScriptTable', order: [[2, 'desc'],[1, 'desc']],//以第三列‘updatedAt’排序,如果第三列 ...
- 查看系统负载:uptime
uptime命令用于查看系统负载,跟 w 命令的输出内容一致 [root@localhost ~]$ uptime :: up days, :, users, load average: 0.03, ...