zoukankan      html  css  js  c++  java
  • 以下示例使用一个 x,y 坐标列表创建了一个多边形几何对象。然后使用裁剪工具来裁剪具有多边形几何对象的要素类。

    import arcpy
    
    # Create an Array object.
    #
    array = arcpy.Array()
    
    # List of coordinates.
    #
    coordList = ['1.0;1.0','1.0;10.0','10.0;10.0','10.0;1.0']
    
    # For each coordinate set, create a point object and add the x- and 
    #   y-coordinates to the point object, then add the point object 
    #   to the array object.
    #
    for coordPair in coordList:
        x, y = coordPair.split(";")
        pnt = arcpy.Point(x,y)
        array.add(pnt)
    
    # Add in the first point of the array again to close the polygon boundary
    #
    array.add(array.getObject(0))
    
    # Create a polygon geometry object using the array object
    #
    boundaryPolygon = arcpy.Polygon(array)
    
    # Use the geometry to clip an input feature class
    #
    arcpy.Clip_analysis("c:/data/rivers.shp", boundaryPolygon, "c:/data/rivers_clipped.shp")
  • 相关阅读:
    UVA11039
    UVA10970大块巧克力
    UVA10970大块巧克力
    UVA10340子序列
    UVA10340子序列
    UVA10382喷水装置
    UVA10382喷水装置
    UVA10020(最小区间覆盖)
    洛谷 P2141 珠心算测验
    UVa 11292 勇者斗恶龙(The Dragon of Loowater)
  • 原文地址:https://www.cnblogs.com/gisoracle/p/10846368.html
Copyright © 2011-2022 走看看