1

I have a point table called t1 and a polygon table called t2 that are neighbourhoods. I want to record neighbourhoods name from t2 into t1 that falls in. My query is: update t1 set ti.f1 = t2.t2 from t1 inner join t2 on st_intersects (t1.geom, t2.geom);

enter image description here

this works but copy result for first record intersection into the rest of points. In this case Kitsilano.

enter image description here

1 Answer 1

4

After some tries I found the simplest way to do.

update properties_sample ps 
set name_nb = nb.name_nb
from nb 
where st_covers(nb.geom, ps.geom);

Your Answer

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

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