4

In QGIS, how could I get the attribute of the nearest line to a polygon with an expression (or virtual layer)?

I wish to create a new field in the polygon layer(in this case the parcels) with the names of the streets (the line layer) that are nearest of them. I thought I could use aggregate but I didn't find any nearest function to go with it.

enter image description here

2
  • can you specify qgis version ? Commented Apr 5, 2021 at 14:35
  • Mine is 3.16.4-Hannover Commented Apr 5, 2021 at 14:37

1 Answer 1

8

The following expression should work :

array_to_string(overlay_nearest('Streets', StreetNameField)) 

Adapt the expression to your data structure.

From QGIS 3.16 on, i think.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.