{"action":"closed","issue":{"url":"https://api.github.com/repos/r-spatial/sf/issues/431","repository_url":"https://api.github.com/repos/r-spatial/sf","labels_url":"https://api.github.com/repos/r-spatial/sf/issues/431/labels{/name}","comments_url":"https://api.github.com/repos/r-spatial/sf/issues/431/comments","events_url":"https://api.github.com/repos/r-spatial/sf/issues/431/events","html_url":"https://github.com/r-spatial/sf/issues/431","id":244512082,"number":431,"title":"Bug in st_difference?","user":{"login":"karldw","id":12504708,"avatar_url":"https://avatars3.githubusercontent.com/u/12504708?v=4","gravatar_id":"","url":"https://api.github.com/users/karldw","html_url":"https://github.com/karldw","followers_url":"https://api.github.com/users/karldw/followers","following_url":"https://api.github.com/users/karldw/following{/other_user}","gists_url":"https://api.github.com/users/karldw/gists{/gist_id}","starred_url":"https://api.github.com/users/karldw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karldw/subscriptions","organizations_url":"https://api.github.com/users/karldw/orgs","repos_url":"https://api.github.com/users/karldw/repos","events_url":"https://api.github.com/users/karldw/events{/privacy}","received_events_url":"https://api.github.com/users/karldw/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-20T22:15:41Z","updated_at":"2017-07-20T23:54:01Z","closed_at":"2017-07-20T23:54:01Z","body":"I'm having an issue finding points that lie outside a polygon. I thought I could use `st_difference` for that, but it's returning a geometry set with zero features. Is this a bug, or am I misunderstanding `st_difference`?\r\n\r\n\r\n```r\r\nlibrary(sf)\r\nlibrary(dplyr)\r\n\r\nnc <- st_read(system.file(\"gpkg/nc.gpkg\", package = \"sf\"), quiet = TRUE) %>%\r\n  st_union() \r\n\r\n# A lon/lat point north of NC, near Pittsburgh\r\nnot_nc <- st_sfc(st_point(c(-80, 40)), crs = st_crs(nc))\r\n\r\n# These two seem right:\r\nst_intersects(not_nc, nc, sparse = FALSE)  # 1x1 FALSE matrix\r\nst_intersection(not_nc, nc)    # empty geometry set\r\n\r\n# These four seem wrong:\r\nst_difference(not_nc, nc)      # empty geometry set\r\nst_difference(nc, not_nc)      # empty geometry set\r\nst_sym_difference(nc, not_nc)  # empty geometry set\r\nst_union(nc, not_nc)           # empty geometry set\r\n\r\n```"}}
{"actor":{"display_login":"edzer"}}