Skip to main content
Question

How to draw lines from distance and decimal degrees


I have a starting easting and northing and from that I would like to build lines from a number decimal degrees and distances

13 replies

Userlevel 6
Badge +35

Assuming the decimal degrees are a rotation:

Use a CoordinateExtractor to get the coordinates of your starting point, then use the VertexCreator to create a line from your starting location pointing straight north with the required length. Then a Rotator to rotate the line using the start coordinates as the origin.

Note that the Rotator rotates counterclockwise, if you want to make it rotate clockwise multiply the rotation by -1

Userlevel 3
Badge +17

Hi @shanetorrens3, assuming that x, y, distance, angle (degrees) are given as attributes of each input feature, a possible way is:

  1. VertexCreator (Mode: Replace with Point): Create the starting point (x, y).
  2. VertexCreator_2 (Mode: Add Point): Add a point (x + distance, y) to the starting point to create a horizontal line segment having the distance.
  3. Rotator (Rotation Angle: angle, X Origin: x, Y Origin: y): Rotate the line segment around the starting point (x, y) by the angle.
Userlevel 3
Badge +17

Hi @shanetorrens3, assuming that x, y, distance, angle (degrees) are given as attributes of each input feature, a possible way is:

  1. VertexCreator (Mode: Replace with Point): Create the starting point (x, y).
  2. VertexCreator_2 (Mode: Add Point): Add a point (x + distance, y) to the starting point to create a horizontal line segment having the distance.
  3. Rotator (Rotation Angle: angle, X Origin: x, Y Origin: y): Rotate the line segment around the starting point (x, y) by the angle.
oops, exactly same approach! @redgeographics

 

Userlevel 6
Badge +35
oops, exactly same approach! @redgeographics

 

Yes, looks like we were writing our responses at the same time :)

 

 

Badge

Thanks for the feedback, I'm a bit stuck however. I managed to create the first line but what do I need to do to continue the traverse with say another 8 azimuth and distance?

Userlevel 3
Badge +17

Thanks for the feedback, I'm a bit stuck however. I managed to create the first line but what do I need to do to continue the traverse with say another 8 azimuth and distance?

That depends on how the 8 sets of angle and distance are given. It's hard to find a solution unless you clarify the conditions specifically.

 

 

Badge

Hi Takashi,

all the azimuth are decimal degrees with an associated distance. I have worked out my starting point and have managed the first bearing and distance using the solution you guys provided however to add another bearing and distance to that...and then so on?

Userlevel 3
Badge +17

Hi Takashi,

all the azimuth are decimal degrees with an associated distance. I have worked out my starting point and have managed the first bearing and distance using the solution you guys provided however to add another bearing and distance to that...and then so on?

The conditions are still unclear. Does the point have a list attribute storing the angles and distances? Or, are the angles and distances read from an external table?

 

 

Badge

Hi Takashi,

all the azimuth are decimal degrees with an associated distance. I have worked out my starting point and have managed the first bearing and distance using the solution you guys provided however to add another bearing and distance to that...and then so on?

the angles and distances are read from an external excel sheet.

 

 

Userlevel 3
Badge +17

Hi Takashi,

all the azimuth are decimal degrees with an associated distance. I have worked out my starting point and have managed the first bearing and distance using the solution you guys provided however to add another bearing and distance to that...and then so on?

A possible way is: merge all the pairs of angle and distance unconditionally to the point feature and store those values in a list attribute, explode the list to create features for every pair of angle and distance, then perform creating desired lines with the method we have suggested before.

 

The workflow looks like this. In the FeatureMerger, you can perform unconditional merging by setting an identical constant (e.g. 1) to the Join On parameter in both Requestor side and Supplier side. If the Requestor feature has a point geometry originally, the first VertexCreator is not necessary.

 

 

 

 

 

Badge

Hi Takashi,

all the azimuth are decimal degrees with an associated distance. I have worked out my starting point and have managed the first bearing and distance using the solution you guys provided however to add another bearing and distance to that...and then so on?

Thanks Takashi, I will work with this. Thanks.

 

 

Badge

Hi @shanetorrens3, assuming that x, y, distance, angle (degrees) are given as attributes of each input feature, a possible way is:

  1. VertexCreator_2 (Mode: Add Point): Add a point (x + distance, y) to the starting point to create a horizontal line segment having the distance.

I have a similar problem. How do I create the line exactly? In my understanding I only create a second point.

 

Thanks

Badge +24

If you have a feature and connect two consecutive VertexCreators. First with Replace with Point and the Second with Add Point. Both having different x and or y you get a line.

@sta-koe-ru Could it be your question is a different problem than topic starter? Might be better to start your own question explaining your situation.

 

Reply