There are two mistakes in your script.
Since
intersect_ls
is a list, useextend
instead ofappend
. The reason of getting error is that. Because the first item infin_ls
is a geometry, the other is a list, but it should have been a geometry too.fin_ls.append(differ) fin_ls.extend(intersec_ls)
Since
gdf
is aGeoDataFrame
instance, you cannot use parenthesis withgdf
as ingdf( geometry= geom)
. Instead, usegdf = gpd.GeoDataFrame(gdf, geometry=geom)
Or just use gdf = gpd.GeoDataFrame(geometry=geom)
if you didn't define gdf
before. In this case gdf
includes only geometries.