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 ...
随机推荐
- Zookeeper 工作流
一旦ZooKeeper集合启动,它将等待客户端连接.客户端将连接到ZooKeeper集合中的一个节点.它可以是leader或follower节点.一旦客户端被连接,节点将向特定客户端分配会话ID并向该 ...
- C++字符串类型和数字之间的转换
转载:http://www.cnblogs.com/luxiaoxun/archive/2012/08/03/2621803.html 1.字符串数字之间的转换 字符串---字符数组(1)string ...
- SVN版控系统的安装和使用
SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上很多版本控制服务已从CVS迁移到Subversion ...
- 高级类特性----static关键字
static 关键字 当我们编写一个类时,其实就是在描述其对象的属性和行为,而并没有产生实质上的对象,只有通过new关键字才会产生出对象,这时系统才会分配内存空间给对象,其方法才可以供外部调用. 我们 ...
- GIS-011-Cesium 使用 IIS设置
.terrain Content-Type='application/octet-stream'
- 在(MRv1)中JobTracker工作方式
在 Hadoop MapReduce 中,JobTracker 具有两种不同的职责: 管理集群中的计算资源,这涉及到维护活动节点列表.可用和占用的 map 和 reduce slots 列表,以及依据 ...
- java集合的中的集合关系实现或继承关系图
放在这儿一目了然.
- SPI接口功能描述
- Effective C++ —— 继承与面向对象设计(六)
条款32 : 确定你的public继承塑模出is-a关系 以C++进行面向对象编程,最重要的一个规则是:public inheritance(公开继承)意味“is-a”(是一种)的关系.请务必牢记.当 ...
- Java的String详解
Java的String详解 博客分类: Java javaStringString详解常用方法 Java的String类在开发时经常都会被使用到,由此可见String的重要性.经过这次认真仔细的学习 ...