{"action":"created","issue":{"url":"https://api.github.com/repos/ropensci/geojsonio/issues/77","repository_url":"https://api.github.com/repos/ropensci/geojsonio","labels_url":"https://api.github.com/repos/ropensci/geojsonio/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/ropensci/geojsonio/issues/77/comments","events_url":"https://api.github.com/repos/ropensci/geojsonio/issues/77/events","html_url":"https://github.com/ropensci/geojsonio/issues/77","id":134068887,"number":77,"title":"Avoid round trip to disk in geojson_rw?","user":{"login":"ateucher","id":2816635,"avatar_url":"https://avatars.githubusercontent.com/u/2816635?v=3","gravatar_id":"","url":"https://api.github.com/users/ateucher","html_url":"https://github.com/ateucher","followers_url":"https://api.github.com/users/ateucher/followers","following_url":"https://api.github.com/users/ateucher/following{/other_user}","gists_url":"https://api.github.com/users/ateucher/gists{/gist_id}","starred_url":"https://api.github.com/users/ateucher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ateucher/subscriptions","organizations_url":"https://api.github.com/users/ateucher/orgs","repos_url":"https://api.github.com/users/ateucher/repos","events_url":"https://api.github.com/users/ateucher/events{/privacy}","received_events_url":"https://api.github.com/users/ateucher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-16T19:03:52Z","updated_at":"2016-02-16T22:52:31Z","closed_at":null,"body":"There may be a way to avoid the round trip to disk in `geojson_rw` for converting `Spatial` objects to `geojson`, but I haven't quite been able to make it work.\r\n\r\nThe key: you can write to `stdout` with `rgdal::writeOGR`:\r\n\r\n```r\r\nlibrary(rgdal)\r\ncities <- readOGR(system.file(\"vectors\", package = \"rgdal\")[1], \"cities\")\r\nwriteOGR(cities[1:10,], \"/vsistdout/\", \"cities\", driver=\"GeoJSON\")\r\n```\r\n\r\nBut I can't figure out a way to capture the output. I've tried various combinations of `sink()`, `textConnection()`, and `capture.output()` but it's eluded me so far..."},"comment":{"url":"https://api.github.com/repos/ropensci/geojsonio/issues/comments/184907492","html_url":"https://github.com/ropensci/geojsonio/issues/77#issuecomment-184907492","issue_url":"https://api.github.com/repos/ropensci/geojsonio/issues/77","id":184907492,"user":{"login":"sckott","id":577668,"avatar_url":"https://avatars.githubusercontent.com/u/577668?v=3","gravatar_id":"","url":"https://api.github.com/users/sckott","html_url":"https://github.com/sckott","followers_url":"https://api.github.com/users/sckott/followers","following_url":"https://api.github.com/users/sckott/following{/other_user}","gists_url":"https://api.github.com/users/sckott/gists{/gist_id}","starred_url":"https://api.github.com/users/sckott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sckott/subscriptions","organizations_url":"https://api.github.com/users/sckott/orgs","repos_url":"https://api.github.com/users/sckott/repos","events_url":"https://api.github.com/users/sckott/events{/privacy}","received_events_url":"https://api.github.com/users/sckott/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T22:52:31Z","updated_at":"2016-02-16T22:52:31Z","body":"tried a bit, still not found a way to do it. asking around"}}