the objectID will be part of the selection where clause fieldNames.insert(0, 'OID@') with arcpy.da.SearchCursor(fc, fieldNames) as sc: for row in sc: #selects any row in the feature class that has a null attribute if None in row: selectedFcFeatLyr = arcpy.SelectLa...
下面代码先缩放到当前要素,然后再将当前比例尺缩小1.6倍。 defExportToJPGFile(mxd,df,lyr,fidIdx,outputDir,filename,imgWidth=600,imgHeight=500):query="FID={0}".format(fidIdx)arcpy.SelectLayerByAttribute_management(lyr,"NEW_SELECTION",query)# 缩放到所选要素,再将比例尺缩小2倍df.zoomToSelectedFea...
select_1 = arcpy.SelectLayerByAttribute_management (fc, "NEW_SELECTION", "FIPS_CODE = '%s'"%(fip)) Traceback (most recent call last): File "", line 1, in select_1 = arcpy.SelectLayerByAttribute_management (fc, "NEW_SELECTION", "FIPS_CODE = '%s'"%(fip)) File "...
arcpy.SelectLayerByAttribute_management(r"C:\data\roads.shp", "NEW_SELECTION", "road_type = '...
arcpy.SelectLayerByAttribute_management("lyr","NEW_SELECTION",' "RD" < 0.05 ') # Write the selected features to a new featureclass arcpy.CopyFeatures_management("lyr","RD_Train") print'程序结束:'+str(time.ctime()) --- 作者:刘金榜 来源:CSDN 原文:...
典型的工具比如按属性选择(SelectLayerByAttribute)、按位置选择(SelectLayerByLocation),都只能通过要素图层实现。 不仅是要素图层,功能类似的方法还有 MakeRasterLayer(创建栅格图层)、SetLayerRepresentation(创建图层制图表达),个人理解都是在一个虚拟的 ArcMap 或 ArcGIS Pro 程序中加载相关图层,然后其相关工具才能获得...
典型的工具比如按属性选择(SelectLayerByAttribute)、按位 置选择(SelectLayerByLocation),都只能通过要素图层实现。 不仅是要素图层,功能类似的方法还有 MakeRasterLayer(创建 栅格图层)、SetLayerRepresentation(创建图层制图表达),个人 理解都是在一个虚拟的 ArcMap 或 ArcGIS Pro 程序中加载相关图层, 然后其相关工具...
典型的工具比如按属性选择(SelectLayerByAttribute)、按位置选择(SelectLayerByLocation),都只能通过要素图层实现。 不仅是要素图层,功能类似的方法还有 MakeRasterLayer(创建栅格图层)、SetLayerRepresentation(创建图层制图表达),个人理解都是在一个虚拟的 ArcMap 或 ArcGIS Pro 程序中加载相关图层,然后其相关工具才能获得...
deffunc(shp,infeature,smxd,ifield,op):#游标打开要素图层,仅取出需要的字段withda.SearchCursor(shp,ifield)asse_cursor:forse_rowinse_cursor:try:mxd=mapping.MapDocument(smxd)df=mapping.ListDataFrames(mxd)[0]lyr=mapping.ListLayers(mxd,infeature,df)[0]fvalue=se_row[0]arcpy.SelectLayerByAttribute_...
示例1: create_feature_class ▲点赞 7▼ # 需要导入模块: import arcpy [as 别名]# 或者: from arcpy importSpatialReference[as 别名]defcreate_feature_class(out_path, out_name, geom_type, wkid, fields, objectIdField):""" creates a feature class in a given gdb or folder """ifarcpyFound =...