1

How do I create lines for all points on the layer where the same radian and same length of line are representated on all points regardless of the point locations?

GeoCord
  • 13
  • 3
  • What is the -90° angle for? Wouldn't you just need azimuth and distance? – Gabriel Jun 03 '21 at 15:53
  • Yeah, your question does not make sense: azimuth is the angle of the line. Could you provide a screenshot of what you want to achieve? – Babel Jun 03 '21 at 16:06
  • No: -90 degrees is the azimuth. What do you understand an azimuth to be? Can you show us an example? See also here: https://gis.stackexchange.com/q/264422/88814 – Babel Jun 03 '21 at 16:54
  • Edit your question and add the screenshot there. – Babel Jun 03 '21 at 18:19
  • I see: your values are in radians: 4.714 radians = 270 degrees and 1.569 rad = 90 degrees - see: https://en.m.wikipedia.org/wiki/Radian - thus you don't have two values, only one on different units – Babel Jun 03 '21 at 18:21
  • 1
    @GeoCord For my answer to make sense, it'd be good to edit your question removing the ambiguity. – Gabriel Jun 03 '21 at 19:11
  • I meant editing the body of your original post. So your question can benefit others who might have the same problems, making the question as clear as possible helps in search engine results. Comments should also be considered disposable. Welcome to GIS Stack Exchange, which has a little bit different concept than traditional forums. – Gabriel Jun 03 '21 at 19:18
  • Understood, and appreciated. This comment solved it: make_line(start_point($geometry),project(start_point($geometry),4000000,4.714))! – GeoCord Jun 03 '21 at 19:19
  • @Gabriel_C. you should have the privilege to edit the question – Babel Jun 03 '21 at 19:20
  • @Babel I know, but I thought it was a good opportunity to engage a newcomer on how to best ask questions! – Gabriel Jun 03 '21 at 19:20
  • Thank you both! This really helped me out a lot! – GeoCord Jun 03 '21 at 19:21

1 Answers1

2

All you need to achieve what you're looking for is the Geometry by expression tool. Expression:

make_line(start_point($geometry),project(start_point($geometry),4000000,4.714))

This should draw a line 4000km long, if your layer units are meters, at 270° from North. The project function throws a point a certain length away from your original point in a certain direction in radians.

Bear in mind that such long lines will have radically different shapes on different map projections. If you're looking for a loxodrome, you should be working in a conformal projection.

There might also be problems if your line crosses the limits of a projection so you will need to take that into account.

Gabriel
  • 3,136
  • 13
  • 33