Skip to main content
Question

Measure length and width of irregular polygons

  • April 19, 2018
  • 5 replies
  • 558 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • 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
  • 2252 replies
  • 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+22
  • Contributor
  • 2179 replies
  • 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.

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

 

test.fmwt

 

 


  • Author
  • 3 replies
  • 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
Celebrity
  • 7843 replies
  • April 21, 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.

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.