In Spain the Spanish Civil Code says that ” if the tree branches extend over someone else’s land , gardens or patios , the owner of these has the right to insist that the lengths over their property are cut , and if the roots of the trees introduce themselves into that somweone else’s land , they must be cut back to the border of the plot .”
So, these contentious issues are quite clear in the Civil Code . It appears also that the branches can be cut up to the vertical on the border with your property and that of the neighbour . So it is proper to cut those branches which overhang your property but because the wood does not belong to you then you have to give it to the owner and that means throwing it back over the wall .
You can also cut the roots that are coming into your property and here the problem is more difficult , especially if the roots are damaging your home or your pool . In such cases it is important to involve a tree specialist to advise .
