7

I assumed this would be an easy thing to do. I'm loading a point shapefile into a map like this:

layer = arcpy.mapping.Layer(file_name)

Is there a way to get the number of points in the shapefile? I see using the 'Describe' command that I can get some info about things... For instance,

arcpy.Describe(layer).table.fields

Gives me some info about the fields in the underlying table but I can't count the rows.

15

Try int(arcpy.GetCount_management(layer).getOutput(0)): here's the documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.