I have two maps one is normal cluster map and other is a grid map. I want that only at the boundaries the cluster map should follow grid map. Refer to the image, map in violet is my cluster map and map in green is my grid map. In this image grid map is on the outer part(1) but at some points grid map is on the inner part(2).
I am trying to do it in python using Geopandas but not getting any answer.The logic I am thinking is as follows The places where Grid map is on outer side I will take union and the places at which grid map is on inner side I will take intersection but i am not getting the condition logic .
Help me with a python code.