SHARE
TWEET

Untitled

a guest Jun 18th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CountPointsInPolygons <- function(pts, polygons){
  2.   countPts = c()
  3.   for (i in 1:nrow(polygons)) {
  4.     polySelect <- polygons[i,]
  5.     pts2 <- st_intersection(pts, polySelect)
  6.     countPts[i] = nrow(pts2)
  7.  
  8.   }
  9.  
  10.   return(cbind(polygons,countPts))
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top