Solved

How to generate new polygons along a line?

  • 17 March 2022
  • 3 replies
  • 14 views

Badge

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!

icon

Best answer by geomancer 17 March 2022, 16:23

View original

3 replies

Userlevel 4
Badge +36
  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.

Badge

Thank you @geomancer, I will try it!

Userlevel 4
Badge +36

Something like this:

Clone start and end polygons

Reply