I would like to be able to extend the vertices of one polygon to the edge of another polygon, how does the snapping between poligons using python.
The photo shows a representation of my problem.
I would like the orange polygon snap the red contour (the other polygon), as in the photo below.
I am using fiona as shown in this example (How to do snapping in Geopandas?), but I couldn't get the result.
from shapely.ops import snap import geopandas as gpd border_shp = gpd.read_file(...) multipolygon = gpd.read_file(...) for index, row in multipolygon.iterrows(): closest_geom = list(border_shp ['geometry']) snapped_geom = gpd.GeoDataFrame(snap(row['geometry'], closest_geom, 8))
I would be grateful for the help