Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 15 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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