forcoordincoordinates:point.X=coord[0]point.Y=coord[1]array.add(point)# 将array对象构造成多边形polygon=arcpy.Polygon(array)# , 2277可省略# 将内存中的多边形创建为数据库的新要素fgdb="C:/Data/Demo.gdb"fc="newpoly"arcpy.env.workspace=fgdb# 先创建一个空要素arcpy.CreateFeatureclass_management(f...
newFC = arcpy.CreateScratchName(preFix, workspace=arcpy.env.scratchGDB,data_type="FeatureClass")# Create empty polygon featureclass with coordinate system that matches AOI.arcpy.CreateFeatureclass_management(env.scratchGDB, os.path.basename(newFC), shape,"","DISABLED","DISABLED", outputCS)forfiel...
1. arcpy.CreateFeatureclass_management():该函数用于创建一个新的要素类。它将根据指定的参数创建一个空要素类,并返回一个指向新要素类的路径。 2. arcpy.CopyFeatures_management():该函数用于复制要素类。它将指定要素类中的要素复制到新的要素类中,并返回一个指向新要素类的路径。 3. arcpy.CopyRows_managem...
同样地,使用arcpy.CreateFeatureClass_management函数创建一个新的面要素类,并使用arcpy.InsertCursor、arcpy.Array、arcpy.Polygon以及arcpy.Point来插入面要素。 python output_polygon = "polygon_feature_class" # 创建面要素类 arcpy.CreateFeatureClass_management(workspace, output_polygon, "POLYGON") # 定义面的坐...
point_featureClass=arcpy.CreateFeatureclass_management(r'E:\3 coding\py code\arcpy\create\point','point.shp','POINT')#使用arcpy.da.InsertCursor类插入新创建的 点要素 到 点要素类 insertCursor = arcpy.da.InsertCursor(point_featureClass, ['Shape@']) ...
CreateFeatureclass_management(out_path=out_path, out_name=out_name, geometry_type=lookUpGeometry(geom_type), spatial_reference=arcpy.SpatialReference(wkid))[0] for field in fields: if field['name'] != objectIdField: field_names.append(field['name']) arcpy.AddField_management(out_path + os...
arcpy.CreateFeatureclass_management("XX项目.gdb", "公共设施点", "POINT") # 向要素类中添加字段 arcpy.AddField_management("公共设施点", "备注", "TEXT") # 向要素类中添加要素 cursor = arcpy.da.InsertCursor("公共设施点", ["SHAPE@XY", "备注"]) ...
point_Geometry=arcpy.PointGeometry(point)#调用创建要素类工具创建一个 点要素类point_featureClass=arcpy.CreateFeatureclass_management(r'E:\3 coding\py code\arcpy\create\point','point.shp','POINT')#使用arcpy.da.InsertCursor类插入新创建的 点要素 到 点要素类insertCursor = arcpy.da.InsertCursor(point...
arcpy.MakeFeatureLayer_management(outputpath, "parcels_lyr")#根据输入要素类或图层创建临时图层,如果不将此图层保持到磁盘或地图文档,该图层在会话结束后将不会继续存在。 arcpy.SelectLayerByAttribute_management("parcels_lyr", "NEW_SELECTION", '"field" < 4')#按属性表选择图层 ...
fc = 'polygon.shp' arcpy.CreateFeatureclass_management(out_path=outpath,out_name=fc,geometry_type='POLYGON') cursor =arcpy.da.InsertCursor(fc,['SHAPE@']) array = arcpy.Array() point = arcpy.Point() for line in fileinput.input(infile): point.ID,point.X,point.Y = line.split(' ') ...