zoukankan      html  css  js  c++  java
  • arcgis10寻宝 使用一个图层切割一个数据集下所有数据

    arcgis10寻宝 使用一个图层切割一个数据集下所有数据

    # Script Name: Clip Multiple Feature Classes  by giosracle
    # Description: Clips one or more shapefiles
    #              from a folder and places the clipped
    #              feature classes into a geodatabase.
    # Created By:  Insert name here.
    # Date:        Insert date here.

    # Import ArcPy site-package and os modules
    #
    import arcpy
    import os

    # Set the input workspace
    #
    arcpy.env.workspace = arcpy.GetParameterAsText(0)

    # Set the clip featureclass
    #
    clipFeatures = arcpy.GetParameterAsText(1)

    # Set the output workspace
    #
    outWorkspace = arcpy.GetParameterAsText(2)

    # Set the XY tolerance
    #
    clusterTolerance = arcpy.GetParameterAsText(3)

    try:
        # Get a list of the featureclasses in the input folder
        #
        fcs = arcpy.ListFeatureClasses()

        for fc in fcs:  
            # Validate the new feature class name for the output workspace.
            #
            featureClassName = arcpy.ValidateTableName(fc, outWorkspace)
            outFeatureClass = os.path.join(outWorkspace, featureClassName)
           
            # Clip each feature class in the list with the clip feature class.
            # Do not clip the clipFeatures, it may be in the same workspace.
            #
            if fc <> os.path.basename(clipFeatures):
                arcpy.Clip_analysis(fc, clipFeatures, outFeatureClass,
                                    clusterTolerance)

    except:
        arcpy.AddMessage(arcpy.GetMessages(2))
        print arcpy.GetMessages(2)

  • 相关阅读:
    题解 P4111 [HEOI2015]小 Z 的房间
    题解 P3317 [SDOI2014]重建
    题解 P4336 [SHOI2016]黑暗前的幻想乡
    NOIP 模拟 7 考试总结
    NOIP 模拟 7 回家
    NOIP 模拟 7 寿司
    MySQL: 多表查询
    MySQL:设计演员与角色表(多对多)
    MySQL:设计省&市表 (一对多)
    MySQL:多表关系设计(一对多 / 多对多 / 一对一)
  • 原文地址:https://www.cnblogs.com/gisoracle/p/2059540.html
Copyright © 2011-2022 走看看