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")


  • 相关阅读:
    Codeforces Round #535 (Div. 3) 1108C
    Codeforces Round #536 (Div. 2) B. Lunar New Year and Food Ordering
    Leetcode--136. Single Number(easy)
    Leetcode--572. Subtree of Another Tree(easy)
    Leetcode--101. Symmetric Tree(easy)
    Leetcode--680. Valid Palindrome II(easy)
    2017百度之星资格赛 1003 度度熊与邪恶大魔王 背包DP
    台州 OJ 1704 Cheapest Palindrome 回文 区间DP
    洛谷 P1019 单词接龙 深搜
    UVA 11882 Biggest Number 深搜 剪枝
  • 原文地址:https://www.cnblogs.com/gispathfinder/p/5711770.html
Copyright © 2011-2022 走看看