floryar

GetCount not working properly

Discussion created by floryar on May 4, 2012
Latest reply on May 18, 2012 by floryar
Hi,

I am using PyScripter to write code that does the following:

1) Turn an input feature class into a feature layer ("Input_FL"),
2) Turn an ancillary-data feature class into a feature layer ("Ancill_FL"),
3) For each row in "Input_FL", select "Ancill_FL" within 10km,
4) Set Count = arcpy.GetCount_management(Ancill_FL).getOutput(0),
5) Update specific field in row with Count value,
6) Once all rows have finished, create new feature class from feature layer "Input_FL".

Upon checking the results, the majority of counts are correct, but some are off by one or two.  My "checking" consists of performing the selection manually in ArcMap and viewing the selected items counted in the attribute table (along with visual inspection).

Has anyone else experienced this problem?  And does anyone know why arcpy vs. manual selection would produce different counts, and/or why my arcpy results were correct most of the time, but incorrect some of the time? 

Thanks in advance for any help!

Outcomes