Created
January 11, 2020 10:49
-
-
Save tim-salabim/a9740baae9ab879b0c79893132d959a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(V8) | |
library(mapview) | |
library(geojsonsf) | |
ct = v8(global="window") | |
ct$source("https://cdn.jsdelivr.net/npm/[email protected]/dist/flatgeobuf-geojson.min.js") | |
ct$get("Object.keys(window)") | |
fran = sf_geojson(franconia[1, ]) | |
jsfun = V8::JS( | |
"(function(x) { | |
flatgeobuf.serialize(JSON.parse(x)); | |
})" | |
) | |
ct$assign("serialize", jsfun) | |
ct$assign("fran", fran) | |
ct$assign("out", V8::JS("serialize(fran)")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks so much @jeroen!!
This now works nicely and enables me to test things a lot more flexibly.