Closed adithirgis closed 2 years ago
Hi @adithirgis and thanks for your message. Can you share the output of the following code?
library(sf)
library(osmextract)
sessionInfo()
Thanks.
Thanks for the response, here -
> library(sf)
Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE
> library(osmextract)
Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright.
Check the package website, https://docs.ropensci.org/osmextract/, for more details.
> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=English_India.1252 LC_CTYPE=English_India.1252
[3] LC_MONETARY=English_India.1252 LC_NUMERIC=C
[5] LC_TIME=English_India.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] osmextract_0.4.0.9000 sf_1.0-5
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 spdep_1.2-2 pillar_1.6.4
[4] compiler_4.0.5 cellranger_1.1.0 class_7.3-18
[7] tools_4.0.5 boot_1.3-27 corrplot_0.84
[10] rgee_1.1.0 jsonlite_1.7.2 lifecycle_1.0.1
[13] tibble_3.1.4 lattice_0.20-41 png_0.1-7
[16] pkgconfig_2.0.3 rlang_0.4.11 Matrix_1.3-2
[19] cli_3.0.1 DBI_1.1.1 spData_0.3.10
[22] terra_1.4-11 e1071_1.7-7 s2_1.0.7
[25] dplyr_1.0.7 raster_3.5-11 generics_0.1.0
[28] vctrs_0.3.8 classInt_0.4-3 rprojroot_2.0.2
[31] grid_4.0.5 tidyselect_1.1.0 reticulate_1.20
[34] glue_1.6.0 here_1.0.1 R6_2.5.1
[37] processx_3.5.0 fansi_0.4.2 readxl_1.3.1
[40] sp_1.4-5 deldir_0.2-10 purrr_0.3.4
[43] magrittr_2.0.1 ps_1.6.0 codetools_0.2-18
[46] ellipsis_0.3.2 units_0.7-1 assertthat_0.2.1
[49] utf8_1.2.1 KernSmooth_2.23-18 proxy_0.4-25
[52] wk_0.6.0 crayon_1.4.2
Dear @adithirgis, I'm sorry but I can't reproduce your problem so I'm not sure how to help you. Did you load any other package before running oe_get
? Did you modify any global options? Could you create a reprex
(preferably with the smaller OSM extract that creates the problem)?
I also don't get any error with R v4.1.2 or v4.0.5.
Hi!
Thanks for looking into this, I also could not find out the problem, as when I use RStudio Cloud, it all works perfectly well. I am not able to use this on my Windows system. Let me know if I am missing anything, I also did try osmextract::oe_get
. Once again thank you for the package. No, I did not touch any global options, and yes, I think I load sf
before osmextract
.
Here is what I get using reprex -
library(osmextract)
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright.
#> Check the package website, https://docs.ropensci.org/osmextract/, for more details.
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright.
#> Check the package website, https://docs.ropensci.org/osmextract/, for more details.
library(sf)
#> Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE
#> Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE
cycleways_england = oe_get(
"England",
quiet = FALSE,
query = "SELECT * FROM 'lines' WHERE highway = 'cycleway'"
)
#> The input place was matched with: England
#> Error in ...names(): could not find function "...names"
#> The input place was matched with: England
#> Error in ...names(): could not find function "...names"
reprex::reprex(session_info = TRUE)
#> i Non-interactive session, setting `html_preview = FALSE`.
#> CLIPR_ALLOW has not been set, so clipr will not run interactively
#> Error in switch(where, expr = stringify_expression(x_expr), clipboard = ingest_clipboard(), : EXPR must be a length 1 vector
#> i Non-interactive session, setting `html_preview = FALSE`.
#> CLIPR_ALLOW has not been set, so clipr will not run interactively
#> Error in switch(where, expr = stringify_expression(x_expr), clipboard = ingest_clipboard(), : EXPR must be a length 1 vector
Created on 2022-02-05 by the reprex package (v2.0.1)
And in the console I get
> library(osmextract)
Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright.
Check the package website, https://docs.ropensci.org/osmextract/, for more details.
> library(sf)
Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE
> cycleways_england = oe_get(
+ "England",
+ quiet = FALSE,
+ query = "SELECT * FROM 'lines' WHERE highway = 'cycleway'"
+ )
The input place was matched with: England
Error in ...names() : could not find function "...names"
Thanks Adithi
I just noticed that ...names()
function was introduced in R 4.1. I will fix that immediately. Thanks for your report.
Dear @adithirgis, I finally figured out the problem but, unfortunately, none of the tested solutions works for R < 4.1 (see tests in #243). I really don't want to add a strong dependency forcing R >= 4.1 but, for the moment, my only suggestion is to run the code on Rstudio Cloud (or any other approach that runs R >= 4.1). Sorry.
Hello @agila5,
Thank you so much for trying, I will update R sometime or use RStudio Cloud of the version mentioned. Thanks again! Please feel free to close the issue. Thank you!
Hi @adithirgis. I think I fixed the problem that you mentioned with the last commit. If you are still getting any errors/problems, please let me know.
Thanks again for raising this issue.
Hello,
Thank you! Should I reinstall the package again?
Yes, with the following command: remotes::install_github("ropensci/osmextract")
Hi! I want to use OSM data using R and I found this wonderful package
osmextract
. But when I run a simple command to download all polylines available in OSM for India, I get this error shown below. Any help is appreciated, thanks! (This error comes up even when I try to use the examples shown in the README ofosmextract
). I saw this, but sorry could not understand much.