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

  • 2
    Have you seen the answer to this question? I think its pretty close to what you want. – M Bain Jul 22 at 3:32
  • @MBain no I hadn't but that does work as I need it to. Thanks. I'll mark this as a duplicate as it maybe useful for people to find it using the terms I've used. – GeorgeC Jul 22 at 3:46

Browse other questions tagged or ask your own question.