I have two layer of points: 'Measure' (> 2000 points) and 'Control' (5 points).
For each control and measure point, I have a "depth" attribute. I would like to display on symbology of "depth" attribute with the closest point.
For now I can draw a line to the closest point:
Using this geometry expression inside 'Control' symbology:
make_line (
$geometry,
overlay_nearest(
'Measure',
$geometry,
limit:=2
)[1]
)
Now I want to display the difference of depth on this line (Sorry it is in french):
But i don t know how to extract the attribute "depth" from the geometry point I have in expression:
In this screen, 'resultPoints_e74212d8_6062_4c65_bdda_cfebd8bd679f'
is my 'Measure' layer.
The real question is: How to extract attribute from a geometry point ?
In reality, i need to replace the 0 in this formula with the depth attribute of the closest point:
'XY:'||round(length(transform(make_line ( $geometry, overlay_nearest('resultPoints_e74212d8_6062_4c65_bdda_cfebd8bd679f', $geometry, limit:=2)[1]),
'EPSG:4326',
'EPSG:2832')),2)||'m - Z:'||round(0-"depth")||'m'
overlay_nearest
instead of$geometry
(which extract geometry) did you try to put the fieldDepth
?NULL
as result with formula:overlay_nearest('resultPoints_e74212d8_6062_4c65_bdda_cfebd8bd679f', "depth")[0]
limit: = 2
and take the first value of the array[0]
overlay_nearest
that i missed!