Python: select by Location and assign value from the source to the target

Discussion created by GISMAIN on Mar 6, 2014
Latest reply on Sep 6, 2016 by buehlerd
Hi All

I have a polygon layer with a 'lot' field and a points layer. I would like to use python to select the points by location (to find what points are contained in what polygons) and assign the value in the 'lot' field from the polygon layer to the point that is contained in the relevant polygon feature. Not sure how to create that link between the 2 layers...

Any help is much appreciated.
Thank you