2

So I am busy with a aerial fibre plan and have Splitters on certain poles (these layers overlap each other). There are over 3000 poles and only 1699 of those poles that have a splitter on them.

Is there any way I can just select the poles that have splitters on to use these attributes on my splitter layer attributes?

I've tried to do this manually but there's too much room for error

enter image description here

New contributor
Dylan Kew is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • What do you mean by "use these attributes on my splitter layer attributes"? Do you want to join the attributes from your poles to the splitters?
    – Bera
    Commented 9 hours ago

2 Answers 2

2

You can use Select By Expression CTRL+F3:

overlay_nearest(
   layer:='Splitter',
   limit:=1,
   max_distance:=5)

on your Poles layer. Replace Splitter with the name of your splitter layer.

The expression is searching for any splitter feature within a distance of 5 (adjust this value, the units are the units of your CRS, in my case meters) and returns True if there is one.

The reason for using overlay_nearest and a distance instead of overlay_intersects is that sometimes two points that looks like they are on top of each other actually are not, but off by a very small distance.

enter image description here

5
  • So im not sure id im doing something wrong here but it selects all the poles.
    – Dylan Kew
    Commented 9 hours ago
  • Maybe your coordinate system is geographic with units in degrees? Try setting a very small distance, like 0.0001
    – Bera
    Commented 9 hours ago
  • I mean in the expression: Change max_distance:=5 to max_distance:=0.0001
    – Bera
    Commented 9 hours ago
  • 2
    That was it, thank you soo much it worked
    – Dylan Kew
    Commented 9 hours ago
  • 3
    Nice! What should I do when someone answers my question?
    – Bera
    Commented 9 hours ago
2

Another option - use the field calculator to access the field in the poles layer that you want to transfer to the splitter layer with an expression like this:

enter image description here

This expression will set the new field in the splitters layer which is called pole_id to the nearest pole's value for random_id from the poles layer. Note that the layer name is case sensitive.

array_first
    (overlay_nearest
        (layer:='Poles',
         expression:="random_id",
         max_distance:=1
        )
    )

Result: enter image description here

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.