Skip to main content
Solved

Result from Lengthcalculator to create new lines

  • October 19, 2016
  • 4 replies
  • 41 views

franco69
Contributor
Forum|alt.badge.img+8

Hi Guys,

another easy one for you for sure.....but today I'm not fit anyway ...lol

 

I have a polyline (pipeline route), gave a measure on it and calculate the length with a lengthcalculator...now I want take this result to create new lines inside the workspace....but I want only create lines straight with this measure (no curves as the original route)....

the result from the lengthcalculator is not a numeric format so I don't know how to use this attribute in a way to create the lines.

Any solutions?

Thx and greetz from a never ending learning FME User

Franco

Best answer by takashi

Well, probably this workflow satisfies the requirement.

  1. LengthCalculator: Calculate the length of the original line and save the value into an attribute (e.g. "_length").
  2. VertexCreator (Mode: Replace with Point): Replace the line with a point (0, 0).
  3. VertexCreator_2 (Mode: Add Point): Add another vertex point (_length, 0) to the feature, to form the desired straight line.
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.

4 replies

takashi
Celebrity
  • October 19, 2016
It's not easy since your requirement is unclear. From which location (coordinates) should the straight line start? Which direction should the straight line turn? Should the straight line have the same length as the result from the LengthCalculator?

 


franco69
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • October 19, 2016

I need the straight line with the same length as the result yes.

I can start by 0/0 because I will tis line in another database for another issue.

Direction 0 degree


takashi
Celebrity
  • Best Answer
  • October 19, 2016

Well, probably this workflow satisfies the requirement.

  1. LengthCalculator: Calculate the length of the original line and save the value into an attribute (e.g. "_length").
  2. VertexCreator (Mode: Replace with Point): Replace the line with a point (0, 0).
  3. VertexCreator_2 (Mode: Add Point): Add another vertex point (_length, 0) to the feature, to form the desired straight line.

takashi
Celebrity
  • October 20, 2016

Well, probably this workflow satisfies the requirement.

  1. LengthCalculator: Calculate the length of the original line and save the value into an attribute (e.g. "_length").
  2. VertexCreator (Mode: Replace with Point): Replace the line with a point (0, 0).
  3. VertexCreator_2 (Mode: Add Point): Add another vertex point (_length, 0) to the feature, to form the desired straight line.
Alternatively, a GeometryReplacer can also be used.

 

  • Geometry Encoding: GeoJSON
  • Geometry Source: {"type":"LineString", "coordinates":[[0,0],[@Length(),0]]}
or

 

  • Geometry Encoding: OGC Well Known Text
  • Geometry Source: LINESTRING(0 0, @Length() 0)
etc.