Skip to main content
Question

Read orientation from line?

  • February 7, 2022
  • 4 replies
  • 460 views

aron
Supporter
Forum|alt.badge.img+16
  • Supporter

The ultimate goal here is to orient overlapping lines in the same direction so that later offsets will come out neat.

The lines have been processed in multiple steps and when I apply a OrientationExtractor it says: no_orientation. Is there another way to get the orientation, other than the Topologybuilder which is quite slow and requires a few extra calculations? Also is the Orientor the only way to rewrite orientations to a line, or is it possible to copy it somehow with something like a FeatureMerger?

4 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • February 7, 2022

Lines do not have an orientation that can be extracted with the OrientationExtractor. What do you mean by Orientation in this case? If you need the angle of the line, the HorizontalAngleCalculator(custom transformer) might help you here


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • February 7, 2022

Hi @aron​,

A quick way to determine the orientation of a reasonably straight line is to subtract the beginning X and Y coordinate from the end X and Y. A + or - X value gives you the East/West orientation, while +/- Y gives you North/South. If both orientations match, then the lines are OK.

If your lines are close, but not exact, you may want to take the extra step of testing the difference in values between the lines. For example, two lines oriented almost exactly up/down may have a small negative X value for one and small positive value for the other. If the X difference falls below a tolerance, you can consider them equivalent.


aron
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • February 7, 2022
ebygomm wrote:

Lines do not have an orientation that can be extracted with the OrientationExtractor. What do you mean by Orientation in this case? If you need the angle of the line, the HorizontalAngleCalculator(custom transformer) might help you here

Thanks for the clarification! A better wording would have been 'direction', as in a line has a start and a end. I need to make sure two overlying lines have the same direction.


aron
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • February 7, 2022

In case it is of use to anyone, I solved it the following way:

  • Intersector (could also use LineOnLineOverlayer)
  • Snipper, to shorten the lines an inkling and not have any "duplicate positions"
  • CoordinateExtractor x2, to get start and end (0 and -1)
  • InlineQuerier, to find "flipped" lines
  • Orientor, to flip the strays

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings