Question

How to change the length of a line with an attribute table?

  • 14 March 2016
  • 4 replies
  • 9 views

Hello, I have a shapefile with lines that have a length. I would like to extend or shrink these lines by using the data of the attribute table. Can you explain how to proceed ?

thank you,

Fabrice


4 replies

Userlevel 4
Badge +25

The Extender can extend a line, on both ends, and the length of the extension can be taken from an attribute. So in your example if B is your original line and you have an attribute specifying the length of B' you will get B + B'

Userlevel 2
Badge +17

The Extender can extend a line, on both ends, and the length of the extension can be taken from an attribute. So in your example if B is your original line and you have an attribute specifying the length of B' you will get B + B'

Hi @fabkouyou, addition to @redgeographics' answer, you can also use the Snipper transformer to shrink the lines. Set x to Starting Location and set (L - x) to Ending Location. Here x indicates the required shrinking length for one end, and L indicates the length of the original line. L can be calculated with the LengthCalculator or @Length() function.

Userlevel 4

As @redgeographics says, use the Extender. To shrink, use a negative extension length in the Extender.

Hello, thank you very much for your answers. I add "AttributeCreator" to calculate the length to extend or shrink. and after the "Extender. And all is OK

Reply