zoukankan      html  css  js  c++  java
  • 子区域数据合并

    # -*- coding: utf-8 -*-
    # ---------------------------------------------------------------------------
    # mergeSubRegionData.py
    # Created on: 2016-07-27 09:10:17.00000
    # (generated by ArcGIS/ModelBuilder)
    # Description:
    # ---------------------------------------------------------------------------

    # Set the necessary product code
    # import arcinfo


    # Import arcpy module
    import os
    import random
    from itertools import groupby
    import zipfile
    import arcpy

    # Check out any necessary licenses

    # Set Geoprocessing environments
    arcpy.env.overwriteOutput = True

    targetDataset = "E:\guangxi\gxsh.gdb\xian"
    #layerList = ['AGNP','BOUA','DIKL','HFCL','HFCP','HYDA','JCZD','LRDL','LRRL','MXRV','NODE','RESA','RIVL','RVDM','SKUA','SLTA','USLU','WATA','WATL','WSML','WSRL','WSWA','WSWL','XJ']
    #layerList = ['AGNP','BOUA','DIKL','HFCL','HFCP','HYDA','JCZD','LRDL','LRRL','MXRV','NODE','RESA','RIVL','RVDM','SKUA','SLTA','USLU','WATA','WATL','WSML','WSRL','WSWA','WSWL','XJ']
    layerList = ['SKUP']
    path = "E:\guangxi\output0"
    currentFiles = os.listdir(path)

    '''
    for fileName in currentFiles:
    print("-----------------------------------"+fileName+"-----------------------------------")
    for layerName in layerList:
    shpfileName = path + "\" + fileName + "\"+layerName+".shp"
    targetLayer = targetDataset + "\"+layerName
    print(targetLayer)
    arcpy.Append_management(shpfileName, targetLayer, "TEST","","")
    '''


    for layerName in layerList:
    print("-----------------------------------"+layerName+"-----------------------------------")
    for fileName in currentFiles:
    shpfileName = path + "\" + fileName + "\"+layerName+".shp"
    if not os.path.exists(shpfileName):
    continue
    targetLayer = targetDataset + "\"+layerName
    print(shpfileName)
    #arcpy.Append_management(shpfileName, targetLayer, "TEST","","")
    arcpy.Append_management(shpfileName, targetLayer, "NO_TEST","","")
    print("OK")


  • 相关阅读:
    如何“破解”系统分析员考试
    两道简单的入门题
    WPF调用OCX控件
    www.12306.cn是安抚群众心灵的吧?
    FileStream类操作字节和字节数组
    XML基本操作:创建增删改
    asp.net ajax回调函数
    XMLHttpRequest+WebForm模式(接口IHttpHandler)实现ajax
    文件读写操作
    asp.net 中AJAX回调模式(ICallbackEventHandler)
  • 原文地址:https://www.cnblogs.com/gispathfinder/p/5711770.html
Copyright © 2011-2022 走看看