= name #图层重命名,以在后续地图输出时图例能够动态变化 #更新layer图层中的数据源,即选择文件夹中下一个栅格文件显示 lyr.replaceDataSource("D:/Desktop/tu", "RASTER_WORKSPACE", name) df.panToExtent(lyr.getSelectedExtent()) #更改标题名称为对应的栅格文件名 for el
'layer{0}'.format(i), """OID >= {0} ANDOID <= {1}""".format((i, j)))gn_table = arcpy.analysis.GenerateNearTable(lyr, 'c:/testing/testing.gdb/random300','in_memory/outnear{0}'.
arcpy.Buffer_analysis('Plant.shp', 'in_memory/PlantBuffer', '78 Miles') arcpy.Clip_analysis('Routes.shp', 'in_memory/PlantBuffer', 'in_memory/RouteClip') arcpy.Select_analysis('in_memory/RouteClip', 'RoutesSelect.shp', '"CLASS" >= \'3\'') arcpy.Delete_management([ 'in_memory/Pla...
It's funny your code doesn't make it look like your output and input are the same as the error message says. Do you have two layers loaded (in memory from dinking with python or in ArcMap), both named "layer"? Generic layer names like that can be dangerous as if you have two ...
arcpy.management.SelectLayerByLocation("EPP_lyr", "INTERSECT", arcpy.PointGeometry(row[1].labelPoint)) # put all the selected filled feature's ORIG_FID into a list oids += [i[0] for i in da.SearchCursor("EPP_lyr", ("ORIG_FID"))] # every OID which occurs only once are ones we...
arcpy.Delete_management('in_memory/BufferedPoint') 在函数当中遇到这样类似的过程,均可以尝试对于需要反复读取的文件进行上述的处理,将其转移到内存工作空间。其他的一些方法也具有类似的思想,比如对于需要选择一个文件当中特定的几个feature的时候,相比于使用arcpy.Select_analysis生成一个新的文件,一般会更加倾向于使...
# a function used to transfer xy to point.shp def createxyft(in_t, x, y, out_l, point_s): arcpy.MakeXYEventLayer_management(in_t, x, y, out_l) arcpy.CopyFeatures_management(out_l, point_s) # transfer the point and find the nearest road def neargis(gfile): for rr in range...
arcpy.mapping.AddLayerToGroup(df, listedGroupLayer, addLayer, "BOTTOM")[0] I'm getting stuck on the first step: I need to dynamically create an empty layer file (based off of group layer names in a spreadsheet), before referencing it. Any examples of how to create an empty layer fil...
arcpy.AddMessage(u"clip:"+dataset+"to"+out_mdb+"\\"+mylayer) mylayer=mylayer.replace("(","") mylayer=mylayer.replace(")","")#oldoutFC=out_mdb+"\\"+ mylayeroutFC =arcpy.ValidateTableName(mylayer,out_mdb)#arcpy.AddMessage("outFC:"+outFC)#arcpy.Clip_analysis(dataset, jfb_Sele...
The in-memory workspace is temporary and is deleted when the app is closed. To make a permanent copy of the output project that contains notes overlays, specify a notes_gdb and use the saveACopy method from the ArcGISProject class. Using the updateLayerFromJSON function If your web app ...