Re: Polygon Width

18793
14
12-15-2011 08:07 AM
JontyKnox
New Contributor II
Hi there,

I'm having a problem calculating polygon width. Essentially I have a number of polygons (1000+) that are all irregular, majority trapezoids but some others that probably don't even constitute a shape. What i want to do is find out the width of the polygons at their base (lets call this the shortest width of the trapezoid) and at their top (the largest width of the trapezoid).

Any ideas on how I could go about this? Attached is a picture of what I'm dealing with here:
0 Kudos
14 Replies
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Now that time has passed ... in ArcGIS 10 the Minimum Bounding Geometry tool with the RECTANGLE_BY_WIDTH gives you the maximum length and maximum width in the output attributes, MBG_LENGTH and MBG_WIDTH (I suggested this in my previous response). And it is available with ArcView license.  🙂
ChrisSnyder
Regular Contributor III
A very good approximation of the trapezoid top width could be had using a version the "divide and conquer" method described above. This method would not require any simplification of the shape, but would require a bunch of python code, and it assumes that you have a shape that is somewhere in between a rectangle and a triangle (e.g. an elongated trapezoid).

We've already demonstrated that it's pretty easy to get the length of the bottom width edge, and the constituent coordinates of it... The idea then (somewhat similar to the one presented above), would be to derive the minimum convex rectangle, and then construct a series of line bisectors (the more bisectors the better approximation) where the bisectors are at equal increments, say 1% increments, from the right most (or left most) end of the rectangle - we'll call that the "origin" end. The method then would be to "clip" the bisector lines to the trapezoid polygon and then examine the resulting lengths as a function of the distance from the origin end... The linear regression of these lengths/increment distances would then describe the tapper of the trapezoid, and thus, knowing the tapper equation and the rectangle length , you could then estimate an approximate width of the top end of the trapezoid.
DanLee
by Esri Regular Contributor
Esri Regular Contributor
The maximum length and maximum width obtained from the Minimum Bounding Geometry tool with the RECTANGLE_BY_WIDTH option would be pretty close to the height (h) and the bottom width (b) of the trapezoid. You have the trapezoid's shape_area (or you can easily calculate it).

We know the trapezoid area equation as:  A = (1/2) x h (a + b)

Then the top width of the trapezoid would be:  a = (2 x A / h) - b

Hope that gives you good enough estimates, if the shapes are very close to standard trapezoids. No coding is needed.  🙂
JontyKnox
New Contributor II
Hi guys,

Thanks for all the replies. So I finally figured it out, what I did was this:

Bounding by Rectangle> Open attribute table of new .shp> Add field-"Bottom_Width"> Field Calculator- "Bottom Width= (2*Shape_Area/Shape length)-MBG_Width"

'MBG Width' is the maximum shape width at the top of the trapezoid defined by the bounding rectangle.

While this does work, it is not as accurate as it could be, some of my trapezoids are slightly more irregular than I would like so it means there is between a 0.5-2.5ft margin of error. This was acceptable but it would be an interesting task to try and improve upon this in the future.

Thanks again for all the help, it was much appreciated.
DanLee
by Esri Regular Contributor
Esri Regular Contributor
I am glad you got it right. Just want to make a clarification for people who read this thread:

In this calculation:
"Bottom Width= (2*Shape_Area/Shape length)-MBG_Width"

the Shape_Area is the area of the trapezoid, not the area of the bounding rectangle; and Shape length should be MBG_LENGTH (used as the height of the trapezoid).