Skip to main content

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

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?

 


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


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.

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.

 


Reply