I have 2 layers (Point_Orien_Vert
- red points and Point_Centroides
- green points), both are Point Geometry.
I need first to check if the distance between one feature in Point_Orien_Vert
and one feature in Point_Centroide
is smaller than 180 m.
The code below shows how to calculate this distance and it works inside a IF statement.
distance(
@geometry,
closest_point(
geometry(
get_feature_by_id(
'POINT_Centroides',
array_to_string(
overlay_nearest(
'POINT_Centroides', "fid"
)
)
)
)
, @geometry
)
)
If the result is true, I need to calculate in Point_Orien_Vert
layer the difference between the value stored in "Dip_Direct" and the value "Azimute".
Note that a feature from Point_Centroide
will be checked more than an once time from points in Point_Orien_vert
because the distance.
I do not know how to write this second code using self-referencing geometry to do this operation.