I want to extract data of a SpatialPolygonsDataFrame li which intersect with the SpatialPointsDataFrame p R and then create a data frame with the coordinates and values of both objects. I tried
library(sf)
out <- st_intersection(p, li)
I get the error Error in UseMethod("st_intersection") :
no applicable method for 'st_intersection' applied to an object of class "c('SpatialPointsDataFrame', 'SpatialPoints', 'Spatial', 'SpatialVector')"
Not all points intersect with the polygon shape.
How could I extract the data of a polygon shape based on a point shape and then create a data frame of the result?
overdoesn't seem to work with sf objects. – Simbamangu Jun 28 '18 at 18:09