I'm using QGIS 3.28
I want to find the neighboring polygons for each polygon in my layer, which is formed of polygons. Having searched for available solutions, I've come up with this:
https://spatialthoughts.com/2019/05/23/neighbor-polygons-aggregate-qgis/
I applied it accordingly, by adding a new field using the following:
aggregate(
layer:= 'Regions',
aggregate:='concatenate',
expression:= to_string(region_id),
concatenator:=', ',
filter:=intersects($geometry, geometry(@parent))
)
However, it didn't work. I've tried dozens of times, fine-tuning it every single attempt. Sometimes, out of the blue, the setting panel gives me preview results (see screenshot) and I get excited, only to get an error at the runtime, when I check the attributes table; I see the fields set to Null (or most of them) and when I click on "update all", I get the following error:
"an error occurred while evaluating the calculation string: No root node! parsing failed"
Having searched, I learned that this error is almost related to failure parsing some fields, due to their types not being String. I made sure to convert both input and output parameters into String, but to no avail.
- I tried setting the parent to a copy of the layer, but this didn't change anything.
I'm sharing the shape file, the CSV file and other relevant files on my Google Drive: https://drive.google.com/drive/folders/1IpervV7mTMt8GJRpN5icgwh7oGLIZP-o?usp=sharing