I am looking for a tool that would allow me to draw a line in the middle of polygons to calculate the total length of my polygons. I do not have access to the tool 'polygon to centreline'. I would like to avoid drawing the line in the middle of each individual polygon. I received the shapefile with more than 2800 polygons. Any ideas?
Thank you for your help!
That is the tool to use.
You could see if there are any implementations in python for 'medial axis' or 'polygon skeleton', but I suspect that you won't find any that can be easily implemented in a script
As an after thought
one of the rectangle variants since they provide axis information.
Might suffice if your polygons are fairly regular.
I am not totally clear what definition of length you are thinking of for your polygons. If you grab the extent for each polygon, that will give you the maximum and minimum Xs and Ys, which is one way of figure out width and height, depending on what you are interested in calculating.
Joshua, that works if the polygons are axis oriented. For oriented, quasi-regular polygons, the quick minimum area bounding rectangle or what esri calls the 'rectangle by width' are good approximations. For completely irregular or tortuously shaped polygons (ie picture a snake), the medial axis or polygon skeleton are approaches. These can be derived through polygon triangulation or incremental negative buffers until you are left with intersection points as the polygon devolves to points... connect the points and you have an approximation of the internal 'axial line' of the polygon
Hi Elise. To achieve this in ArcGIS for a river centreline, I've used the Create Thiessen Polygons tool. If you convert the polygons to lines, then split the lines into small segments (the smaller the segment, the smoother the centre-line), then create points from the line segments - creating Thiessen polgons from these points will create a centre-line in the middle for any irregular polygon - albeit with a bit of superfluous geometry.
I had to manually edit to leave only the centre-line, but there might be a way to do this without manually editing. Which you'll need with over 2800 polys 🙂
John, that is the polygon triangulation method mentioned here
to continue your process you