sf
                                
                                 sf copied to clipboard
                                
                                    sf copied to clipboard
                            
                            
                            
                        st_join removing geometry from y may be undesirable
Currently st_join() removes the geometry from y which for some geometries may be fine, such as the case where both geometries in x and y are POINTs. However when both geometries are polygons this may be undesirable, the join will return all columns but the geometry from y but the other columns from y may lose context without their geometry.
A work around to this would be to use something like dplyr::row_number() to add a column to y that would uniquely identify the geometry, then it would get carried over in st_join() and then you could use dplyr::inner_join() to add it back in, however this isn't particularly elegant.
Is there a better way than this? Is it worth changing st_join() to allow both geometries through?
At a glance, changing this line
https://github.com/r-spatial/sf/blob/f36719c43e8ceffd16107d12f35ca38dc739c538/R/join.R#L141
so that it simplifies y to a dataframe (or tibble) would work unless I'm missing something
It's not that simple, but a PR to make this an option is welcome.