我目前有一个搜索游标,它遍历ArcGIS 10.1中的shapefile,该文件选择一个要素并对该要素(并且仅对该要素)运行视域分析。在Python中将相同特征导出到具有相同名称的shapefile的最简单方法是什么?
fieldFID = 'FID'
arcpy.CheckOutExtension("Spatial")
arcpy.MakeFeatureLayer_management (inPoints, "pts")
with arcpy.da.SearchCursor('pts',[fieldFID]) as cursor:
for row in cursor:
fid = str(row[0])
print fid
arcpy.SelectLayerByAttribute_management ("pts", "NEW_SELECTION", '"FID" = {}'.format(fid))
outViewshed = Viewshed(inDEM,"pts",1,"CURVED_EARTH",0.15)
outViewshed.save("C:/temp/output/viewsheds/"+fid)
1
一般而言,所有ArcGIS GP操作都基于1)所选要素,以及2)如果未选择全部数据集,则表现为全部。因此,只要您选择了功能,就只会导出那些功能。
—
RyanKDalton