Skip to main content

Hi All,

 

I'm working on a workflow to identify if line is perpendicular and shows the same X at both vertex . Below a screenshot that shows a line pointing to the north but the X (top vertex) is different to X (bottom vertex). imageThe aim of the is fail the lines which are not perpendicular and show different Xs,

 

I was thinking about TopoBuilder but can't get it to work,

 

Any ideas? Thanks :)

 

 

 

 

 

Not sure if this is what you are looking for, but I use the LabelPointReplacer to get the ParallelRotation direction of a line.

  • GeometryExtractor (FME Binary) to backup the geometry to an attribute.
  • LabelPointReplacer with label 1 and labelheight 1 to replace the line with a label.
  • AttributeExposer to expose ParallelRotation.
  • GeometryReplacer to restore the original geometry from the attribute.
  •  

Once you have the directions of the lines in attributes, you can calculate if it is 90 degrees different from the one you are testing.


In addition to @nielsgerrits​ very novel solution, I can think of two more approaches:

  • There's a HorizontalAngleCalculator custom transformer available on the FME Hub, which calculates the angles of line features, a line with both x coordinates the same will have an angle of 90 or 270 degrees
  • The CoordinateExtractor can extract coordinate values into a list (_indices{}), assuming you have a 2-point line you can then test to see if _indices{0}.x = _indices{1}.x

Thanks @nielsgerrits​  and @Hans van der Maarel​  both solutions worked perfectly :)


Reply