{"action":"opened","issue":{"url":"https://api.github.com/repos/rstudio/leaflet/issues/237","repository_url":"https://api.github.com/repos/rstudio/leaflet","labels_url":"https://api.github.com/repos/rstudio/leaflet/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/leaflet/issues/237/comments","events_url":"https://api.github.com/repos/rstudio/leaflet/issues/237/events","html_url":"https://github.com/rstudio/leaflet/issues/237","id":132844412,"number":237,"title":"FR: Geobuf / running JS on server","user":{"login":"ideamotor","id":1654283,"avatar_url":"https://avatars.githubusercontent.com/u/1654283?v=3","gravatar_id":"","url":"https://api.github.com/users/ideamotor","html_url":"https://github.com/ideamotor","followers_url":"https://api.github.com/users/ideamotor/followers","following_url":"https://api.github.com/users/ideamotor/following{/other_user}","gists_url":"https://api.github.com/users/ideamotor/gists{/gist_id}","starred_url":"https://api.github.com/users/ideamotor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideamotor/subscriptions","organizations_url":"https://api.github.com/users/ideamotor/orgs","repos_url":"https://api.github.com/users/ideamotor/repos","events_url":"https://api.github.com/users/ideamotor/events{/privacy}","received_events_url":"https://api.github.com/users/ideamotor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-10T23:05:24Z","updated_at":"2016-02-10T23:05:24Z","closed_at":null,"body":"An issue we have is the bandwidth required for users to receive large GeoJSON files (which works for points, polygons, lines, etc). There's a number of different solutions for this but it appears [Geobuf](https://github.com/mapbox/geobuf) is the best solution, particularly because it is being developed by the same developer as Leaflet. It's a lossless compression of GeoJSON into [Google Protocol Buffers](https://github.com/google/protobuf). It requires [pbf](https://github.com/mapbox/pbf). I have a test script with no issues in HTML/JS.\r\n\r\nThe client needs to run a function `var geojson = geobuf.decode(new Pbf(buffer));` which is simple enough in addGeoJSON. However, I'm having difficulty getting it encoded and sent in this format with JS on the server, ala `var buffer = geobuf.encode(statesData, new Pbf())`. I could possibly resort to using a separate node instance and use the command line, or use [pygeobuf](https://github.com/mapbox/pygeobuf) along with [rPython](https://cran.r-project.org/web/packages/rPython/index.html). However, I suspect this would be an improvement for many folks.\r\n\r\nDo you have any tips or thoughts on how I could integrate this? I noticed [RProtoBuf](https://github.com/eddelbuettel/rprotobuf) as well.\r\n\r\nChris\r\n"}}