My aim is to find the 'non-overlap' between two GeoPandas DataFrame. In other words the result should exclude the intersection between gdf1
and gdf2
.
I am aware that I can iterate through the geometries as follows:
data=[]
for index, orig in gdf1.iterrows():
for index2, ref in gdf2.iterrows():
if ref['geometry'].symmetric_difference(orig['geometry']):
data.append({'geometry':ref['geometry'].symmetric_difference(orig['geometry'])})
df = gpd.GeoDataFrame(data,columns=['geometry'])
However, I would like to know if there is a way of doing the symmetric difference using gdp.sjoin
Here is the code for intersection:
gis = gpd.sjoin(gdf1, gdf2, how='left', predicate='intersects')
I am looking for the code for the symmetric difference.
The following link does not specify how to do it with the symmetric difference.
https://geopandas.org/en/stable/docs/reference/api/geopandas.sjoin.html