Hot answers tagged

6 votes

Creating Checkbox list in Python script tool dialog ArcGIS Pro

Make a parameter with a Data Type = String and Multiple values enabled Set Filter to Value List and add your map names: When you run the tool, you can select individual maps from the dropdown, or ...
  • 54.3k
1 vote

Converting Pandas DataFrame to point feature dataset via ArcGIS function (e.g. XY Table To Point) in ArcPy

You can use da.InsertCursor: import arcpy, os import pandas as pd output_path = r"C:\GIS\data\tempdata" output_name= "points12345.shp" sr = arcpy.SpatialReference(3006) #Create a ...
  • 55.3k
1 vote

Name output feature classes with feature names with ArcPy

You are appending the currentDate after the .shp file extension. Change your loop to something similar to this: for fc in fcList currentDate = str(now.month) + str(now.day) + str(now.year) ...
1 vote

ArcPy command to get the number of features in map layer

The reason your code didn't work is that you provided the layer source (lyr.dataSource), not the layer (lyr). Functions which accept layers will honor a source, by converting it to a layer, with ...
  • 19.1k
1 vote

ArcPy command to get the number of features in map layer

arcpy.GetCount_management(lyr) It will honour definition queries and return a count of features in the layer. If there are any selected features, it will return a count of the selected features only. ...
  • 54.3k
1 vote

ArcPy SelectLayerByLocation cannot retrieve selected features

The program is mostly correct. It needs two updates to make it work: First, change with ap.da.SearchCursor(Lyr2, ['SHAPE@', 'Name']) as cur: to with ap.da.UpdateCursor(Lyr2, ['SHAPE@', 'Name']) as cur:...
  • 1,087

Only top scored, non community-wiki answers of a minimum length are eligible