I have polygons inside another bigger single polygon and I want to be able to replace the ID values (for example) of the former polygon to that of the latter.
Suppose I have a geodataframe with 3 polygons and the IDs of them are [8, 20, 55]
. Now, these polygons are actually inside another bigger polygon (second geodataframe) with an ID of [2]
. I want to know how it is possible to convert the values of [8,20,55]
from the first geodataframe to [2,2,2]
according to the bigger polygon from the second geodataframe. Conceptually the image looks like this:
Use
sjoin
: