批量Append

GIS数据是按照图幅号组织的,现需要每个单独的系统数据进行拼接。

以下是批量追加代码:

# ---------------------------------------------------------------------------
# Append.py
# Created on: 2013-01-21 10:25:22.00000
#   (generated by ArcGIS/ModelBuilder)
# Description: 
# ---------------------------------------------------------------------------# Import arcpy module
import arcpy
import os.path
import time
from arcpy import envSHP = "E:\\lastquick1w"
dicAllFC={}
fcall=[]
gdbAllPath=[]
#Get Dataset and FeatureClass,Store in dicAllFC,Key =ds value= fc
if os.path.exists(SHP):for dirpath,dirnames,filenames in os.walk(SHP):for filename in filenames:if os.path.splitext(filename)[1]=='.mdb':mdbfilepath = os.path.join(dirpath,filename)gdbAllPath.append(mdbfilepath)env.workspace=mdbfilepathdatasetlist = arcpy.ListDatasets("","Feature")for dataset in datasetlist:if isinstance(mdbfilepath,unicode):env.workspace = mdbfilepath+"\\"+datasetelse:env.workspace = mdbfilepath+"\\"+dataset.decode('utf-8').encode('gb2312')fclist = arcpy.ListFeatureClasses("")if fclist and len(fclist)>0:if not dicAllFC.has_key(dataset):dicAllFC[dataset]=fclistbreakbreak
#Get All MDB Path
if os.path.exists(SHP):for dirpath,dirnames,filenames in os.walk(SHP):for filename in filenames:if os.path.splitext(filename)[1]=='.mdb':if os.path.join(dirpath,filename) not in gdbAllPath:gdbAllPath.append(os.path.join(dirpath,filename))
for (k,v) in dicAllFC.items():for singlefc in v:for singlegdbPath in gdbAllPath:if isinstance(singlegdbPath,unicode):fcFullPath = singlegdbPath+"\\"+k+"\\"+singlefcelse:fcFullPath = singlegdbPath+"\\"+k.decode('utf-8').encode('gb2312')+"\\"+singlefc.decode('utf-8').encode('gb2312')if arcpy.Exists(fcFullPath) and fcFullPath not in fcall:fcall.append(fcFullPath)else:print fcFullPath + " Not Exist ****************************************"if fcall and len(fcall)>=2:targetFC = fcall.pop(0)try:arcpy.Append_management(fcall,targetFC,"TEST","","");print targetFC+"@@@succeed At "+time.strftime("%Y-%m-%d %X",time.localtime())+"###Contains "+str(len(fcall))fcall=[]except Exception as inst:print targetFC+"@@@Failed At "+time.strftime("%Y-%m-%d %X",time.localtime())+"###Contains "+str(len(fcall))fcall=[]
print "Complete At"+time.strftime("%Y-%m-%d %X",time.localtime())
View Code

 

代码图片如下:

转载于:https://www.cnblogs.com/514687800/p/3528674.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/575599.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

jquery ajax php中 css样式不显示,Chrome浏览器在Ajax同步调用之前不会显示Jquery的动态css Propery更改...

我有如下因素HTML节点:上的click事件会触发聊天对象的方法this.addUser function(trigger_node, id, is_silent, session, show_block_message){if(trigger_node){this.bk_trigger_node.html trigger_node.innerHTML;this.bk_trigger_node.cn trigger_node.class…

Silverlight与Asp.net之间的调用及参数传递

共有两种方式来传递初始化参数 1)在html或者aspx页面中object对象中加入一下代码 参数格式&#xff1a;参数名 值&#xff0c;参数名 值&#xff0c;... <param name"initParams" value "name John , sex m"/> 取得参数的方法 在app页面中…

email协议与服务器关系,常见的邮件协议:POP3、IMAP、SMTP之间的区别和联系

POP3POP3是Post Office Protocol 3的简称&#xff0c;即邮局协议的第3个版本&#xff0c;是TCP/IP协议族中的一员&#xff0c;主要用于支持使用客户端远程管理在服务器上的电子邮件。POP3是因特网电子邮件的第一个离线协议标准&#xff0c;允许用户从服务器上把邮件存储到本地主…

php 连接mssql

以前用的都是mysql&#xff0c;今天突然想用下mssql&#xff0c;起先用的是sql server200. 第一种方法 打开mssql.dll拓展。然后把mssql.secure_connection off改为on 使用mssql拓展。类似于mysql拓展库 $connmssql_connect((local),sa,); if(!$conn){ //die(mssql_error()); …

2013年未之wpf项目乱述

不知识为何现已很少在网上发帖,貌似人生的方向已经看的七七八八.要么用心工作,要么自主创业.无论怎么样,对于现在的我来说都是一种淡定的选择。作为一个c#程序员&#xff0c;今年下半年开始使用wpf&#xff0c;更觉得wpf将来肯定会是win 客户端上的首选技术。 今年在公司共用wp…

Silverlight 出现“无法加载 URI 的内容。URI 可能无效”错误的解决方案

在程序操作过程中偶尔会出现如标题所示的错误&#xff0c;开始一直不知道怎么回事&#xff0c;后来仔细调试了下&#xff0c;发现是在浏览器可以点击“前进/后退”按钮时&#xff0c;同时按住shift鼠标滚轮滚动会出现这个Bug。 上网查找了下&#xff0c;有些浏览器Shift鼠标滚轮…

asp.net之动态页面和静态页面的区别

asp.net之动态页面和静态页面的区别 当我开始接触web开发的时候&#xff0c;首先学到的是html、css、js这一类网页语言&#xff0c;通过布局可以搭建出一个静态网站&#xff0c;效果也跟我们上网时经常看到的一些网站一样了。于是都感觉很有成就感了。 可是什么又是动态语言呢?…

GeoPoint与LocationData

生成GeoPoint&#xff1a; new GeoPoint((int)(locData.latitude* 1e6), (int)(locData.longitude* 1e6)) Done&#xff01;转载于:https://www.cnblogs.com/xingyyy/p/3538983.html

原型对象prototype和原型属性[[Prototype]]

构造器&#xff1a;可以被 new 运算符调用, Boolean,Number,String,Date,RegExp,Error,Function,Array,Object 都是构造器&#xff0c;他们有各自的实现方式。 比如&#xff1a;var snew String("test") s的 [[Prototype]] 内部属性设定为标准内置的字符串原型对象&a…

(转) PowerDesigner中Table视图同时显示Code和Name

PowerDesigner中Table视图同时显示Code和Name,像下图这样的效果&#xff1a; 实现方法&#xff1a;Tools-Display Preference 转载于:https://www.cnblogs.com/wallis0922/p/3548402.html

Linux下部署Hadoop伪分布模式

Hadoop版本为1.2.1 Distribution为Fedora19并使用hadoop账号安装 第一步&#xff1a;配置ssh本地登录证书&#xff08;虽然为伪分布模式&#xff0c;Hadoop依然会使用SSH进行通信&#xff09; [hadooppromote ~]$ which ssh /usr/bin/ssh [hadooppromote ~]$ which ssh-keygen …

Fedora-19安装texlive2013并配置中文

参考博文&#xff1a; http://blog.csdn.net/longerzone/article/details/8129124 之前通过yum install安装了texlive&#xff0c;不过在使用过程中老是报错&#xff0c;后来通过下载完整iso安装成功&#xff0c;并成功配置了中文&#xff08;真是一个折腾啊&#xff09; 现将…

【Java】RuleSource约束常用方法整理

1-常用约束规则RuleSource的设置方法例如&#xff1a;addRules(new Rules(ProgramFeeItem.class){protected void initRules() {add("rateClass", all(new Constraint[] { required() })); //required表示&#xff0c;不可为空add("remark", rules.maxLen…

C语言编程基础 打印图形

C语言中用循环可以打印出各种图形1 直角三角形(靠右直立)&#xff1a;部分代码int i,j;for (i0; i<6; i) {for (j6;j>i ;j-- ) {printf("");}for (j0; j<i; j) {printf("*");}printf("\n");}2.等腰三角形&#xff08;直立&#xff09;部…

PHP的ISAPI和FastCGI比较

1、CGI&#xff08;通用网关接口/Common Gateway Interface&#xff09;一般是可执行程序&#xff0c;例如EXE文件&#xff0c;和WEB服务器各自占据着不同的进程,而且一般一个CGI程序只能处理一个用户请求。这样&#xff0c;当用 户请求数量非常多时&#xff0c;会大量占用系统…

辨析*P++,*(p++),*(++p),++(*p),*(P--),*(--P)

1&#xff0c;*p由于和*同等优先级&#xff0c;结合方向为自右向左&#xff0c;因此它等价与*&#xff08;p&#xff09;。先引用p的值&#xff0c;实现*p的运算&#xff0c;然后再使p自增1。注意 其中为什么是先执行*p然后再执行*p&#xff0c;不应该是先执行括号里的p再执行*…

chrome密码管理

chrome://settings/passwords ------------------------------- [系统盘]:\Documents and Settings\[用户名]\Local Settings\Application Data\Google\Chrome\User Data\Default\Login Data &#xff08;这个路径是 Win XP 系统&#xff09; 你可以用 SQLite Database Browse…

牛客网刷题错题记录

目录 Java 1.静态内部类 2.关于String&#xff0c;StringBuilder以及StringBuffer 3.java语言特性 4.非抽象类实现接口的问题 5.互斥锁 6. Socket 通信编程 7.类的初始化顺序 8.变量的存储区 9.jvm线程共享问题 10.java内存回收问题 11.关于java concurrent包四个类…

android Intent和IntentFilter

android的应用程序包含三种重要的组件&#xff1a;Activity、Service、BroadcastReceiver&#xff0c;应用程序采用一致的方式来启动他们——都是依靠Intent来进行启动。Intent就封装了程序想要启动的程序意图&#xff0c;不仅如此&#xff0c;Intent还可用于与被启动组件交换信…

冒泡排序的双重循环理解

主要说一下冒泡排序的一些关键地方的个人理解&#xff0c;比如算法思想&#xff0c;两个循环的作用意义&#xff0c;中间循环变量范围的确定等。 原理&#xff1a;比较两个相邻的元素&#xff0c;将值大的元素交换至右端。思路&#xff1a;依次比较相邻的两个数&#xff0c;将小…