概述
# Import system modules
import arcpy
# Set the workspace
arcpy.env.workspace = "c:/data/mexico.gdb"
# Make a layer from the feature class
arcpy.MakeFeatureLayer_management("cities", "lyr")
# Select all cities which overlap the chihuahua polygon
arcpy.SelectLayerByLocation_management("lyr", "intersect", "chihuahua", 0, "new_selection")
# Within selected features, further select only those cities which have a population > 10,000
arcpy.SelectLayerByAttribute_management("lyr", "SUBSET_SELECTION", '"population" > 10000')
# Write the selected features to a new featureclass
arcpy.CopyFeatures_management("lyr", "chihuahua_10000plus")
最后一行也许就是你要找的那一行。如果在具有选择的图层上运行该操作,则只会导出选定的要素。但是,如果在要素类或形状文件上执行此操作,则将复制所有要素。在
如果您还没有从要素类或shapefile生成一个图层文件,那么我建议您使用arcpy.MakeFeatureLayer_management("cities", "lyr")命令。在
最后
以上就是瘦瘦电脑为你收集整理的arcgis python 导出统计表_使用python(ArcMap 10.5.1)将ArcGIS中的选定属性导出到新图层?...的全部内容,希望文章能够帮你解决arcgis python 导出统计表_使用python(ArcMap 10.5.1)将ArcGIS中的选定属性导出到新图层?...所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复