Skip to main content
Solved

Measure angle between points

  • May 2, 2018
  • 2 replies
  • 160 views

aron
Enthusiast
Forum|alt.badge.img+16
  • Enthusiast
  • 136 replies

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

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.

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+60
  • Celebrity
  • 3703 replies
  • May 2, 2018

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
Celebrity
  • 7843 replies
  • 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