arcpy.MakeFeatureLayer_management(outputpath, "parcels_lyr")#根据输入要素类或图层创建临时图层,如果不将此图层保持到磁盘或地图文档,该图层在会话结束后将不会继续存在。 arcpy.SelectLayerByAttribute_management("parcels_lyr", "NEW_SELECTION", '"field" < 4')#按属性表选择图层 arcpy.DeleteRows_management(...
arcpy.MakeFeatureLayer_management(Routes,'TempRouteLyr')foriinCountLine: arcpy.MakeFeatureLayer_management(Lines,'TempLineLyr','"FID" = {0}'.format(str(i))) sc = arcpy.da.SearchCursor('TempLineLyr', ['IMPACT'] TempImpact = sc.next()[0]delsc Selection = arcpy.SelectLayerByLocation_managem...
# ---按属性选择,并创建新图层--- def XJTC(in_features1, out_layer1, where_clause1): in_features = in_features1 # 输入图层 out_layer = out_layer1 # 筛选后创建的临时图层名 where_clause = where_clause1 # 选择语句 arcpy.MakeFeatureLayer_management(in_features, out_layer, where_clause) ...
MakeFeatureLayer_management 函数用于创建一个新的要素图层,并根据指定的属性条件和空间关系选择要素。该函数的语法如下: arcpy.MakeFeatureLayer_management(in_features, out_layer, where_clause, workspace, field_info) 其中,in_features 是输入要素类,out_layer 是输出图层,where_clause 是属性条件表达式,workspace ...
SelectLayerByLocation_management(in_layer,{overlap_type},{select_features},{search_distance},{selection_type}) 测试主要代码如下: Exp1: import arcpy arcpy.env.workspace = "D:/ArcpyBook/data/CityOfSanAntonio.gdb" try: #flayer = arcpy.MakeFeatureLayer_management("Burglary","Burglary_Layer") ...
arcpy.MakeFeatureLayer_management(Routes, 'TempRouteLyr') arcpy.MakeFeatureLayer_management(Lines, 'TempLineLyr', '"FID" = {0}'.format(str(i))) sc = arcpy.da.SearchCursor('TempLineLyr', [ 'IMPACT' ] TempImpact = sc.next()[0] del sc Selection = arcpy.SelectLayerByLocation_management(...
arcpy.management.Delete_Feature:用于删除指定的地图要素集合中的要素,可以指定要删除的要素集合等信息。
lyr1 = arcpy.MakeRasterLayer_management(attExtract1, 'short_lyr') 又或者有多个输出的工具,比如渔网工具会输出一个点图层和一 个面图层,那么就使用 getOutput(0) 和 getOutput(1) 获得不同的输 出结果。 2.MakeFeatureLayer MakeFeatureLayer 是创建要素图层方法,类似的还有 MakeRasterLayer(创建栅格图层)、...
# 需要導入模塊: import arcpy [as 別名]# 或者: from arcpy importDelete_management[as 別名]defgetClosestSegment(point, segments, maxdist):arcpy.Delete_management('segments_lyr') arcpy.MakeFeatureLayer_management(segments,'segments_lyr') arcpy.SelectLayerByLocation_management ("segments_lyr","WITHIN_...
使用arcpy.SelectLayerByAttribute_management函数执行按属性选择: 这个函数用于根据指定的SQL查询语句选择要素。你需要提供一个要素图层(可以通过arcpy.MakeFeatureLayer_management函数创建),以及选择模式和SQL查询语句。 python arcpy.MakeFeatureLayer_management(input_feature_class, "selected_layer") arcpy.SelectLayerByAtt...