Skip to main content
Solved

How to generate new polygons along a line?


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.

View original
Did this help you find an answer to your question?

3 replies

geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • 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.


Forum|alt.badge.img
  • Author
  • March 18, 2022

Thank you @geomancer, I will try it!


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • March 18, 2022

Something like this:

Clone start and end polygons


Reply


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