Is that possible to keep entities who haven't join entities in Geopandas Spatial Join ?


join = gpd.sjoin(buf, grouped_aquis, op='contains')

I would like to keep buf's entities that haven't grouped_aquis' entities joined.


By default sjoin does a 'inner' join, meaning that only those records are kept that actually joined with a record in grouped_aquis. To also keep the ones that did not have a joining match, you can use an 'left' join:

join = gpd.sjoin(buf, grouped_aquis, op='contains', how='left')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.