Fast spatial filtering
See original GitHub issueSometimes I have a subset of objects which I would like to keep only if they intersect/are contained by/are within another subset of objects.
I think the only way of doing this efficiently (with spatial indexes) in geopandas right now is with sjoin. However, sjoin appends columns from the one frame to the other.
Therefore, I think it would be nice if there was a way to do sjoin with (how='onlyleft' or how='onlyright'), to specify that a filter is being done without columns being appended.
Alternatively, adding a function purely for filtering would be a syntactically clearer way of expressing the same idea.
Issue Analytics
- State:
 - Created 5 years ago
 - Comments:15 (6 by maintainers)
 
Top Results From Across the Web
3D fast spatial filtering method - ACM Digital Library
Spatial image filtering is a method by which an image can be enhanced. The method involves computing correlation of a mask and input...
Read more >3D fast spatial filtering method | Request PDF
Spatial image filtering is a method by which an image can be enhanced. The method involves computing correlation of a mask and input...
Read more >Spatial Filtering - an overview
Spatial filtering is the most commonly applied filtering in digital ... The fast holographic response of photorefractive semiconductors at the wavelengths ...
Read more >Dynamic spatial filtering using a digital micromirror device ...
Here, we propose a novel dynamic spatial filtering method that perfectly eliminates the diffraction noise for DMD based high-speed angle-scan ODT systems.
Read more >Fast Implementation of Spatial Averaging
We present a new fast spatial averaging (FSA) technique that efficiently implements operations for spatial averaging or mean filtering.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

What I have been thinking about before is adding something like
geopandas.clipfunction (alongsidesjoinandoverlay), which might be related. Although that might not just do filtering, but also “clip” individual geometries that don’t fall fully inside the other set of geometries, so thisclipwould be more similar tooverlaybut without adding attributes and with only taking the full extent of the other geometries into account (although this could also be an option).I’ve updated my answer to fix a memory leak with the prepared objects. I’ve now tested using
-fsanitize=addressand no leaks are detected.