我是靠谱客的博主 无奈高山,这篇文章主要介绍使用ArcGIS字段计算器计算要素的拐点坐标(线,面要素),现在分享给大家,希望可以做个参考。

使用ArcGIS字段计算器计算要素的拐点坐标(线,面要素)

打开字段计算器,如下图,选择python,显示代码块,粘贴以下代码。dd=GetpointXY( !Shape! ),参数选Shape字段。

确定

代码块如下:

def GetpointXY(feat):
    partnum = 0
    # Count the number of points in the current multipart feature
    partcount = feat.partCount
    pntcount = 0
    # Enter while loop for each part in the feature (if a singlepart
    # feature this will occur only once)
    pointxy=""
    while partnum < partcount:
        part = feat.getPart(partnum)
        pointxy+=str(partnum+1)+":"
        pnt = part.next()
        # Enter while loop for each vertex
        while pnt:
            pntcount += 1
            if pnt:
                pointxy+=str(pntcount)+":"+str(pnt.X)+","+str(pnt.Y)+";"
            pnt = part.next()

            # If pnt is null, either the part is finished or there
            # is an interior ring
            #
            if not pnt:
                pnt = part.next()
        partnum += 1
    return pointxy

注意:字段长度要设长一些,如果超限的话会执行不了。

 

 

 

最后

以上就是无奈高山最近收集整理的关于使用ArcGIS字段计算器计算要素的拐点坐标(线,面要素)的全部内容,更多相关使用ArcGIS字段计算器计算要素内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部