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 ...
随机推荐
- 什么是Apache ZooKeeper?
Apache ZooKeeper是由集群(节点组)使用的一种服务,用于在自身之间协调,并通过稳健的同步技术维护共享数据.ZooKeeper本身是一个分布式应用程序,为写入分布式应用程序提供服务. Zo ...
- js中以键值对的形式当枚举
js中以键值对的形式当枚举var Penum= { B: "姓名", C: "所属居委", D: "证件号", E: "性别&qu ...
- android大扫盲之SurfaceView,SurfaceHolder,SurfaceHolder.CallBack
最近接触到了SurfaceView,SurfaceHolder,SurfaceHolder.CallBack,一直不求其解,现在来粗浅认识一下它们. 先看一下官方的定义: 1.SurfaceView ...
- jdbcType 与 Java type
JDBC Type Java Type CHAR String VARCHAR String LONGVARCHAR ...
- Android学习笔记——Menu(一)
背景: Android3.0(API level 11)开始,Android设备不再需要专门的菜单键. 随着这种变化,Android app应该取消对传统6项菜单的依赖.取而代之的是提供anction ...
- Ubuntu 14.04 Server i386 安装 Oracle11g_11.2.0.3 RAC
文档地址:doc 文档地址:doc
- ChemOffice Professional 16.0新增了哪些功能
ChemOffice Professional 16.0是为终极化学和生物组件设计,可满足化学家和生物学家的需求.ChemOffice Professional帮助科学家有效地检索数据库,包括SciF ...
- laravel 集合接口
只记下几个常用的,其他的看这里:http://laravelacademy.org/post/6293.html 1)什么是集合? 就是laravel查询构建器查询返回的数据结果(get first ...
- cgitb--CGI跟踪模块(简化异常调试)
通过启动cgitb模块,可以在web浏览器窗口查看详细的编码异常信息,而不必不停地跳转到web服务器的日志屏幕查看,更方便的定位问题: 异常解决后需关闭CGI跟踪. 在CGI脚本最前面增加如下两行,启 ...
- ZooKeeper(五)-- Curator使用
前言 Curator是Netflix开源的一套ZooKeeper客户端框架: 1.封装ZooKeeper client与ZooKeeper server之间的连接处理; 2.提供了一套Fluent风格 ...