obrl-soil / h3jsr

Access Uber's h3-js library via R and V8 - https://uber.github.io/h3/#/documentation/overview/use-cases
https://obrl-soil.github.io/h3jsr/
Other
67 stars 5 forks source link

ubuntu only bug : h3_to_polygon #5

Closed Curycu closed 4 years ago

Curycu commented 4 years ago

caution : Windows10, macOS works fine. error occurs only with ubuntu 18.04 lts.

> h3_to_polygon(input = '8730e1caeffffff')
# Error in context_eval(join(src), private$context, serialize) :
# TypeError: undefined is not a function

> is_valid('8730e1caeffffff')
# [1] TRUE

ironically example script works fine

screen_shot_01

my session info

> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] h3jsr_1.1.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6       magrittr_1.5       units_0.6-6        tidyselect_1.0.0
 [5] R6_2.4.1           rlang_0.4.6        dplyr_0.8.5        tools_3.4.4
 [9] grid_3.4.4         KernSmooth_2.23-15 e1071_1.7-3        DBI_1.1.0
[13] ellipsis_0.3.0     class_7.3-14       assertthat_0.2.1   lifecycle_0.2.0
[17] tibble_3.0.1       crayon_1.3.4       sf_0.9-2           purrr_0.3.4
[21] tidyr_1.0.2        vctrs_0.2.4        curl_4.3           glue_1.4.0
[25] geojsonsf_1.3.3    V8_3.0.2           pillar_1.4.4       compiler_3.4.4
[29] classInt_0.4-3     jsonlite_1.6.1     pkgconfig_2.0.3
obrl-soil commented 4 years ago

Yeah there's something funny going on in the CI tests too, although 18.04 is fine for me and 16.04 fails with a similar error - see https://github.com/obrl-soil/h3jsr/runs/628522908?check_suite_focus=true. Its going to be one of the spatial or JS package dependencies behind R, just not sure which one yet.

Curycu commented 4 years ago

maybe JS package dependencies I guess, because C library base H3 package works fine on same environment : https://github.com/crazycapivara/h3-r

obrl-soil commented 4 years ago

Yeah I'd say your version of libv8 needs an upgrade - you can check by running library(V8) in R, it reports the version in your console. If you see <6, you need to upgrade. Look at https://github.com/jeroen/V8 for instructions, and let me know if that doesn't solve things.

Curycu commented 4 years ago

it works! thank you! my server was using V8 engine 3.14.5.9

sudo -i
apt-get install -y software-properties-common
add-apt-repository ppa:cran/v8
apt-get update
apt-get install -y libnode-dev
Rscript -e 'devtools::install_github("obrl-soil/h3jsr")'