Hello everyone,
I am currently using ArcGIS Pro 2.9 and trying to create polygons from numerous xy coords. However, there are numerous problems with the layout of the data in the attribute table that I need help addressing. The data was originally exported from an outside source as an excel file. Below is a table I made that gives an idea of what my data looks like. Each row represents a polygon. Each column is a xy coordinate representing a vertex.
Polygon 1 | vertex xy | vertex xy 2 | vertex xy 3 | vertex xy 4 | vertex xy 5 |
Polygon 2 | vertex xy | vertex xy 2 | vertex xy 3 | vertex xy 4 | vertex xy 5 |
Polygon 3 | vertex xy | vertex xy 2 | vertex xy 3 | vertex xy 4 | vertex xy 5 |
1) the first issue is that the x and y coords are in the same column. I know how to separate them on Excel, however, each polygon has a different number of vertices, and it goes up to 85. If I separated the x,y coords into separate columns, I would be working with 170 columns.
2) The second and main issue is that there are numerous xy coords in numerous columns. Many of the tools I looked at had one spot for an x field, and one for a y field. I don't even know where to start when I have 85/170 columns.
I have looked through many forums for potential solutions for turning points into polygons. There are about 12,000 rows, representing 12,000 polygons. It would take me a lot of time and effort to manually group the vertices together. And many of the point to polygon tools I saw looked like they only went up to 4 vertices per polygon.
Any suggestions at all would be greatly appreciated! Thank you!
I think you'll need a multi-step approach, starting with reformatting your excel table using macros or copilot if you have that available. Ultimately you'll want to wind up with a table like below, where you list out one row per vertex, which becomes your sort order 1, 2, 3, etc.:
Polygon ID | Sort Order (Vertex) | x | y |
Polygon1 | 1 | X coord | Y coord |
Polygon1 | 2 | X coord | Y coord |
Polygon1 | 3 | X coord | Y coord |
Polygon1 | 4 | X coord | Y coord |
Polygon1 | 5 | X coord | Y coord |
Polygon2 | 1 | X coord | Y coord |
Polygon2 | 2 | X coord | Y coord |
Polygon2 | 3 | X coord | Y coord |
Polygon2 | 4 | X coord | Y coord |
Once the table is formatted you can convert it to a point feature class using the XY Table To Point tool. Then run Points To Line tool where Polygon ID is the Line ID field, using your sort order field, and tick the box to "close the line" which creates the missing segment to create a closed polyline feature. Finally run the Feature To Polygon tool.
The hardest part of this will be formatting the excel sheet. I'm happy to have a stab if you post your data here.