1

I am using ArcGIS Desktop 10.5.

In land consolidation projects, to determine success of the project, we use shape indices. For this purpose to calculate shape indices, I need to know how many points creates each polygon in attribute table.

asked Feb 22, 2018 at 10:01
1
  • Add geometry attributes will do a job. Commented Feb 22, 2018 at 19:36

1 Answer 1

4

From How To: Count the vertices for line or polygon features in ArcMap 10:

Procedure

1.Right-click the layer to be evaluated in the Table of Contents and click Open Attribute Table.

2.From the Table Options drop-down, click Add Field to add a new field to the table.

3.Name the field VxCount and select Long Integer for the field type. Click OK.

4.Right-click the heading of the new field and click Field Calculator. Under Parser, select Python. In the main expression box, set:

VxCount = !shape!.pointcount

If you dont want to count the polygon start and endpoint (which is at the same location) twice:

VxCount = !shape!.pointcount-1
answered Feb 22, 2018 at 10:16
4
  • 1
    @Fırat Arslan , nice, can you accept my answer with the checkbox? Commented Feb 23, 2018 at 6:03
  • +1, but three remarks: i) python is case sensitive, so you should use "pointCount" (capital C) ii) shape is the geometry field name, which could also be Shape or a completely different name (also case sensitive) iii) If the geometry is correct, there will be a start and an end point "closing" the polygon, at the same position. so for index computation, it is more relevant to use !Shape!.pointCount -1 Commented Feb 23, 2018 at 7:45
  • @radouxju, I just copy-pasted it from ESRI :). I tried it now though both on a fc in a file geodatabase and a shapefile and it is not case sensitive on pointcount or shape. Commented Feb 23, 2018 at 8:11
  • I also tested with field calculator on 10.4 and you are right (not cases sensitive) but python usually is case sensitive and arcpy is less forgiving than the field calculator Commented Feb 23, 2018 at 10:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.