Skip to content

Semi-join?

4 messages · Edzer Pebesma, Tim Keitt

#
I keep finding things that are trivial in sql are not so in R, so perhaps
you can help me out.

What would be the way in the 'sf' package to retain only polygons from one
coverage that intersect points in another coverage? I think that's a
semi-join.

Roughly: 'select a.* from polys a, points b where st_intersects(a.geom,
b.geom)'

Thanks.

THK
#
On 5/7/19 8:29 PM, Tim Keitt wrote:
a[b,]

# or

st_join(a, b, left = FALSE) # no left join gives you inner join

  
    
#
On Tue, May 7, 2019 at 1:39 PM Edzer Pebesma <edzer.pebesma at uni-muenster.de>
wrote:
Hmm... tried this and for some reasons it was not giving me what I wanted.
I will investigate.

THK

  
    
#
Thanks. Works now. It was an issue with map projections.

THK
On Tue, May 7, 2019 at 3:18 PM Tim Keitt <tkeitt at utexas.edu> wrote: