Skip to main content
Solved

How to generate new polygons along a line?

  • March 17, 2022
  • 3 replies
  • 55 views

gerard
Participant
Forum|alt.badge.img

Hi,

I have a set of polygons following a line like shows attached figure. The distance between these polygons along the line are the same.

 

Objective: I have to create some polygons at the end/beginning of the line in the same line direction. Line could be in any direction, not only horizontal.

 

Method (FME Desktop 2020): The original dataset is a polygon shapefile, so (1) I have computed a layer with center point of polygons, and (2) I have constructed a Line (LineBuilder) with this ordered points to know the line direction. (3) I generate a new polygon at the beginning or end of this line at some known distance. The size of new polygon is the same as the original ones, and I have to translate the polygon along the line (In fact, I have to generate several (n) new polygons along the line equally spaced (d)):

  • I have extend the line (LineExtender, n*d),
  • split the line n times to get center points,
  • and then I have to create a new polygon in every center point.

 

Question: Is it possible to make this workflow in a more efficient way? maybe using other transformers, maybe with other point of view, ...

 

I look forward to hearing your expert suggestions, thank you!

Best answer by geomancer

  1. Determine DeltaX and DeltaY between 2 adjacent polygons.
  2. Isolate the first polygon (can you use a Sampler? can you filter on an ID?)
  3. Use a Cloner to make n copies. Cloner adds an attribute _copynum, ranging from 0 to n-1
  4. Use an Offsetter to move each new polygon with DeltaX * _copynum * -1.0 and DeltaX * _copynum * -1.0
  5. Isolate the last polygon, perform the same steps (but don't multiply the X and Y offsets with -1.0)

Note: from your description and your image it appears the polygons are overlapping.

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.

3 replies

geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • 932 replies
  • Best Answer
  • March 17, 2022
  1. Determine DeltaX and DeltaY between 2 adjacent polygons.
  2. Isolate the first polygon (can you use a Sampler? can you filter on an ID?)
  3. Use a Cloner to make n copies. Cloner adds an attribute _copynum, ranging from 0 to n-1
  4. Use an Offsetter to move each new polygon with DeltaX * _copynum * -1.0 and DeltaX * _copynum * -1.0
  5. Isolate the last polygon, perform the same steps (but don't multiply the X and Y offsets with -1.0)

Note: from your description and your image it appears the polygons are overlapping.


gerard
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • 15 replies
  • March 18, 2022

Thank you @geomancer, I will try it!


geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • 932 replies
  • March 18, 2022

Something like this:

Clone start and end polygons