I have a shp file with hundreds of features that represent clipped segments of coastline. Each segment is made up of many vertices (dozens, perhaps even hundreds). (FYI, the segments were created by using circles 1km in diameter to clip the coastline at random locations. The clipped segments of coastline are quite convoluted, I am looking to evaluate just how convoluted each polyline is.)
I need to calculate the fractal dimension of each individual segment (polyline). In order to be able to compare them.
I am working with ArcMap 10.1, I also just got QGIS but am not proficient with this program.
I know what the mathematical formula is to calculate fractal dimension for a single line segment, but I have far too many to calculate them individually, and I do not know how to write a script that could do it for me.
Using the box counting method: Each line segment (or segment of coastline) is covered by a sequence of grids of descending sizes and then two values are recorded for each of the grids: the number of boxes that intersect with the line, N(L), and the side length of the box, L.
Note that N(L) ∝ L^(-D)
The fractal dimension is calculated as the slope of the linear regression best-fit line of log–log data.
Therefore: D = (logN)/[log(1/L)]
!shape!.pointcount - 1
could be used support.esri.com/en/knowledgebase/techarticles/detail/38864 - even if the formula is in a linked question, if it is key to this question then I think it should be included here to enable it to standalone.!shape!.length
(or equivilent?), and that just leaves the straight-line distance between the first and last vertex to figure out and incorporate in the formula. I lean toward option 2...