Skip to main content
Question

Measure length and width of irregular polygons


Hi,

I have numerous irregular polygons which comes out from a raster extents coercer.

What I need is to determine the length along a certain degree heading as well as the width perpendicular to the length measurement for all of these polygons.

My idea was to perhaps extract a centre point in all polygons and then draw a line forward and backwards till it reaches the polygon boundary along the desired heading. The width measurement would be similar however with a 90 degree rotation to the previous line extension.

Would really appreciate if someone had some good advice on this.

5 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • April 19, 2018

I would try rotating (Rotator using the center point) the geometry to get the measures horizontal and vertical and the create a bounding box (BoundingBoxReplacer).

The box will get you the width and height.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • April 19, 2018

the result would totally depend on the shape of the polygons.

Why choose center point? No reason to assume it would represent some "axis".

Maybe just densify the polygons. Extract vertices.

Unconditionally merge them. Create lines form those.

Find (or keep) line(s) which are closest to required orientation. (using for instance the azimuth calculator)

Extract length and statistically calculate the min and max.

(you could make an iterative process to continue until the min max does not change significantly.)


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • April 19, 2018
erik_jan wrote:

I would try rotating (Rotator using the center point) the geometry to get the measures horizontal and vertical and the create a bounding box (BoundingBoxReplacer).

The box will get you the width and height.

I created an example template for this case, using FME 2018:

 

test.fmwt

 

 


  • Author
  • April 20, 2018

I played around yesterday and found that an orientated bounding box which I then can align to a desired heading, chop up and then measure the lines would give me the desired length and width which suffices in a quick manner.


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • April 21, 2018
rody wrote:

I played around yesterday and found that an orientated bounding box which I then can align to a desired heading, chop up and then measure the lines would give me the desired length and width which suffices in a quick manner.

Good catch. If your goal is to get short/long side lengths of the oriented bounding box, you can just specify attribute names to the Length of Shorter/Longer Attribute parameters in the BoundingBoxReplacer.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings