(八)arcpy开发&利用arcpy在arcgis中创建属性表

今天我们来学习一下,关于在arcgis中,使用arcpy来创建属性表。其中使用到的函数为

CreateFeatureclass_management,在使用该函数创建属性表需要注意的是需要定义好投影,我们来看一下实现的代码。


geometry_type = "POLYGON"
spatial_reference = arcpy.SpatialReference(102100)

featureClassNamesList = ['guizhou', 'hunan', 'yunnan' ]

arcpy.env.workspace = current_workspace
arcpy.env.overwriteOutput = True

def createFeatureClass(in_fc_name):
    arcpy.CreateFeatureclass_management(current_workspace, in_fc_name, geometry_type, "", "DISABLED", "DISABLED", spatial_reference)
    print('Feature Class ' + in_fc_name + ' was sucessfully created.')


createFC = [createFeatureClass(fc) for fc in featureClassNamesList]

最后的实现效果如下图所示。


                                                                       更多内容,敬请关注公众号

                                                                

转载自:https://blog.csdn.net/u010608964/article/details/86691062

You may also like...