1

I have (⋅)p1 and (⋅)p2, two geographic points (wgs84) with latitude, longitude, and altitude.

I need to calculate point (⋅)p3 in a specific distance (in meters) from (⋅)p2 along (⋅)p1 to (⋅)p2.

enter image description here

Any suggestion formula?

1
  • 1
    You need both of the Problems of Geodesy to solve this. Inverse finds the bearing from p1 to p2, then Forward find the location with p1, bearing and distance. You can calculate it one-off using the US Geodetic Survey web site. (You don't want the formula, because it's a partial differential equation with trig functions out the wazoo.)
    – Vince
    Commented Nov 13, 2022 at 19:36

1 Answer 1

0

If using QGIS, you can use expressions with "Geometry Generator" or "Geometry by expression" - see here for details.

The function extend() extends the start and end of a linestring geometry by a specified amount.

If you already have a line, just use extend([line_geometry], 0, [distance]) to extend it at the second point. If working on a point layer, use this expression:

extend (
    make_line (
        geometry(get_feature_by_id(@layer, 1)),
        geometry(get_feature_by_id(@layer, 2))
    ),
    0,1
)

As your layer seems to be in WGS84, units are in degrees, so no meaningful distance values are possible. First reproject the layer to a geographic CRS apt for measurements in your area of interest - e.g. the local UTM zone.

3
  • 1
    Nice effort, but this question is probably not about QGIS >_<
    – Taras
    Commented Nov 13, 2022 at 18:50
  • Not sure, why do you think? OP has not included any info about software used.
    – Babel
    Commented Nov 13, 2022 at 18:58
  • I suppose, the OP asking about the geodetic principle of extrapolation the point
    – Taras
    Commented Nov 13, 2022 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.