I wanted to geopandas.overlay() on lines and polygons : get the geometries from the lines that are not in the polygons.
I tried using geopandas for this :
result = gpd.overlay(my_lines, my_polygons, how='difference')
but I get this error :
TypeError: overlay only takes GeoDataFrames with (multi)polygon
geometries
since the overlay method only supports polygons, I did the difference using pyqgis. However I want to know if there is a way to bypass this typeError using geopandas and shapely ?
Best Answer
Meanwhile here is the solution I wrote using pyqgis, it works for me :
for this to work, one has to import processing: