Skip to main content
Solved

Measure angle between points


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

I have some point objects that need to be rotated. The source data has a starting position and contains a offset in metres from the origin. This would give me two points and from there I could draw a line between the two and finaly measure the angle of this line using AzimutCalculator. Ergo my rotation value.

I need some advice on the best way to construct the line.

So far I have tried combinations of the Offseter, VertexCreator and LineBuilder to construct the new point but I have not found a way to pair this with the source object. The features all come with an unique ID, but I have not figured out how to pair the original back to the offset point before drawing the connecting line.

Below is an early embryo just to give an example of what I am trying to do.

Best answer by takashi

Hi @aron, unclear the conditions, but if the point feature has offset amounts in x direction and y direction as its attributes, you can extract the coordinates (x0, y0) of the original point with a CoordinateExtractor, calculate coordinates (x1, y1) of the destination point based on (x0, y0) and the offset amounts, and then transform the point to a line which connects between the original point (x0, y0) and the destination point (x1, y1) with a VertexCreator (Mode: Add Point).

  • x1 = x0 + offset x
  • y1 = y0 + offset y

View original
Did this help you find an answer to your question?

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

Could you share your workspace (a template preferably so the source data is included)? I think that would make it easier to work towards a solution.


takashi
Influencer
  • Best Answer
  • May 2, 2018

Hi @aron, unclear the conditions, but if the point feature has offset amounts in x direction and y direction as its attributes, you can extract the coordinates (x0, y0) of the original point with a CoordinateExtractor, calculate coordinates (x1, y1) of the destination point based on (x0, y0) and the offset amounts, and then transform the point to a line which connects between the original point (x0, y0) and the destination point (x1, y1) with a VertexCreator (Mode: Add Point).

  • x1 = x0 + offset x
  • y1 = y0 + offset y


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