I have a shapefile of polygon parcels. Each parcel has a unique id called propertyno.
I need to label the vertices of my polygons clockwise sequentially, starting at the most northern vertex in alphabetically order (A,B,C,D,E...).
I came across this tool (http://ianbroad.com/arcgis-toolbox-create-points-at-corners-of-polygon-with-arcpy/) from a previous thread which will identify corner vertices only and label them NW/NE/SW/SE,etc. The trouble is that it sometimes skips corners as my polygons are not all square. Some polygons have 4 vertices, some have up to 30. Additionally which vertex is the origin vertex will change depending on the orientation of my shapefile. It's not always the NW corner.
I am using ArcGIS 10.6 ModelBuilder and have thus far done the following steps:
- converted polygon features to vertices
- added x/y coordinates
- sorted the vertices based on
propertyno (order unimportant but used ascending)
andPOINT_Y
(descending, order is important)
Here is a screenshot of the attribute table of the sorted vertices.
I think what I need next in ModelBuilder or in Python code is to loop through the propertyno
field, and for every polygon sequentially number the rows based on how many there are. Then start again for the next propertyno set of points.
I am a beginner coder and have not used iterations at all in ModelBuilder. The process I have in ModelBuilder so far is to take my polygon layer, create a points layer from the vertices, add the X/Y coordinates. Add a text "VERTEX_ID" field where the letter value for the point will go, and sort the points based on a polygon ID field (propertyno) and by the Y Coord. I still need to delete duplicate vertices (the first/last of the closed polygon is the same) and to do some sort of insert cursor to alphabetically label the points.
How do I go about doing this?