我是靠谱客的博主 瘦瘦电脑,这篇文章主要介绍arcgis python 导出统计表_使用python(ArcMap 10.5.1)将ArcGIS中的选定属性导出到新图层?...,现在分享给大家,希望可以做个参考。

# 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内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部