Message |
Here is a fast and simple way to obtain an "average width," in some well-defined sense.
Your polygons are composed of thin rectangles. For a rectangle of length L and width W, A := area = LW and P := perimeter = 2(L+W). Having computed A and P (which are fast in ArcView), you can therefore solve for L and W.
This approach will not always work--it fails for a circle, for instance--but it should give good results for your data and is fast enough to apply to 60,000 polygons.
Use the code below in the Field Calculator. Copy the code to a script editor, name it (I named mine "Polygon.Width"), and compile it. Create a numeric field for the polygon widths. Use the Field Calculator expression
av.Run("Polygon.Width", [shape])
to compute the widths.
If you are familiar with the quadratic formula you might wonder why I didn't just compute W directly as (P - Delta.Sqrt)/4. The reason is that this form is numerically less reliable, especially for long skinny shapes.
To summarize, at this point you have a good working definition of "maximum width" based on the skeleton idea and a good working definition of "average width."
"Minimum width" is tougher. Intuitively, we could define it geographically: if the polygon is the map of an island, the minimum width is the shortest distance across the island.
To make this well-defined, we should demand that routes across the island which merely "cut off a corner" don't count; otherwise, one could cut arbitrarily small corners and conclude all polygons have minimum width of zero, which is not terribly useful.
One definition of what it means to cross the island without cutting a corner is that after making such a crossing, if you were to return to the starting point by following the shoreline (in either direction), you would have to circle at least halfway back.
More precisely, start at any point Q on the boundary of the polygon. Define two other boundary points (not necessarily distinct) Q' and Q'' by traveling in either direction from Q along the boundary until the first point at which your direction of travel has changed by at least 180 degrees.
The total change in direction as you circumnavigate the island is 360 degrees, so necessarily you pass through the 180 degree point at least once along the way. This implies Q' and Q'' always exist.
(There are complications dealing with lack of well-defined direction at the vertices, but these can be dealt with rigorously.)
Now *remove* all the shoreline along which you had to travel in going from Q to Q' and Q to Q'' (but don't remove Q' or Q'', respectively). Call the remaining portion of the boundary the "shore opposite Q." (It may be just the single point Q' = Q'', but it is never empty. It will also include any rings of the polygon other than the ring on which Q lies, if the polygon is multiply connected.)
We could define the minimum width of the island, then, to be the length of the shortest line segment on the island that connects a point of the boundary to its opposite shore.
(Alternative definitions include not requiring the line segment to lie entirely within the island, or replacing "line segment" by "continuous path.")
The results will not always square with your intuition: for example, the minimum width of the United States in this sense is probably just a few meters! All you need is some protrusion, some isthmus, however short. For simple polygons like yours, such bad behavior is unlikely. However, this simple strange example points out that a "minimum" width may not be a very useful concept in general.
Evidently a straightforward computation of this minimum width would require a lot of effort. It is feasible: besides inspecting each vertex (to calculate its opposite shore), you would have to inspect each segment. Fortunately, all points along a segment share the same opposite shore. So if we take our definition to mean "smallest distance between points and their opposite shores," we just compute the distances between each segment and its opposite shore, between each vertex and its opposite shore, and take the smallest of all these distances. This works for simple polygons and can be extended to handle multiply connected polygons. Evidently the maximum total effort is proportional to N^2 where N is the number of vertices. |