3

I have a network of edges and nodes located within 3 zones, as shown in the image below:

enter image description here

I want to know, for each node, which zone it belongs to. Is there a way to extract the information?

So that I have a column in the attributes of the vertices with either Zone_1, Zone_2 or Zone_3? (In reality I have a bigger network with many zones, and would like a fast way to recover this information for each node)

0

2 Answers 2

3

You can apply an Intersection (Vector -> Geoprocessing Tools -> Intersection...) using your point data as Input layer and the zonal polygons as Overlay layer. This will add the intersected polygon's attributes to each point (you can also also select specific attributes to keep).

0
0

if you doesn't want create a new layer using Intersection tool, you can:

  1. create a new field in your point layer and call it as 'fk_id_polygon'

  2. writing this formula by field calculator

    aggregate(

    layer:='layer_name_polygon',
    aggregate:='max',
    expression:= "id_polygon",
    filter:= within(geometry(@parent),$geometry) )

the formula retrieve the field "id_polygon" from polygon table and write the value in attribute cell, for only point within polygons.

"id_polygon" field has to be a unique value that identify each single polygon.

After that you can do Join between 'fk_polygon_id' and 'id_polygon'

or instead of use 'id_polygon' you can use 'name' so to associate Zone name directly at your points

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.