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.
-
Add geometry attributes will do a job.FelixIP– FelixIP2018年02月22日 19:36:38 +00:00Commented Feb 22, 2018 at 19:36
1 Answer 1
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
-
1@Fırat Arslan , nice, can you accept my answer with the checkbox?Bera– Bera2018年02月23日 06:03:35 +00:00Commented 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 -1radouxju– radouxju2018年02月23日 07:45:27 +00:00Commented 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.Bera– Bera2018年02月23日 08:11:39 +00:00Commented 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 calculatorradouxju– radouxju2018年02月23日 10:15:52 +00:00Commented Feb 23, 2018 at 10:15