0

I need to get a value from a point table based on the end/start point of a line. This is similar to my question QGIS Field Calculator Aggregation with a intersect query

aggregate( layer:= 'Point_Clip', aggregate:='concatenate', expression:=to_string(RL), concatenator:=', ', filter:=intersects($geometry, geometry(@parent)) )

This doesn't always put the start point (based on the direction of the line) and then the end point.

If I get the start/end points using geom_to_wkt(start_point($geometry))

Can I use this to get the value...I was trying something like

dbquery('Point_Clip','Name','start_point(@geometry) intersects $geometry')

But this gives errors I can't work out. In the end I need it to run in the QGIS Attributes form so that it also fills values from the points at the start/end of existing and new lines using something like

if(regexp_substr(aggregate(
layer:= 'Point_Clip',
aggregate:='concatenate',
expression:= to_string(Name),
concatenator:=', ',
filter:=intersects($geometry,
geometry(@parent))),'(.*),')='',geomintersects('Point_Clip','Name'),regexp_substr(aggregate(
layer:= 'Point_Clip',
aggregate:='concatenate',
expression:= to_string(Name),
concatenator:=', ',
filter:=intersects($geometry,
geometry(@parent))),'(.*),'))

The test data is only about 20 lines and points - it can be downloaded from https://drive.google.com/file/d/12rUV_pAaevs9vATbIsgc9QJvvziRygGN/view?usp=sharing

GeorgeC
  • 8,228
  • 7
  • 52
  • 136

0 Answers0