Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: [each] Command expects a single value. #77

Closed
tim-salabim opened this issue Apr 18, 2018 · 7 comments
Closed

Error: [each] Command expects a single value. #77

tim-salabim opened this issue Apr 18, 2018 · 7 comments

Comments

@tim-salabim
Copy link

tim-salabim commented Apr 18, 2018

Hi,
on my windows machine at work when I run the following code

library(mapview)
library(rmapshaper)

tst = ms_simplify(franconia, sys = TRUE)

I receive the following error (and warnings)

Error: [each] Command expects a single value. Received: 'rmapshaperid = this.id'
Run mapshaper -h to view help
Cannot open data source C:\Users\TIM~1.APP\AppData\Local\Temp\RtmpITMI68\file107020a34084.geojson
Error in CPL_read_ogr(dsn, layer, as.character(options), quiet, type,  : 
  Open failed.
In addition: Warning message:
running command 'mapshaper C:/Users/tim.appelhans/AppData/Local/Temp/RtmpITMI68/file10704dc97bbc.geojson snap -simplify 0.05  weighting=0.7 -filter remove-empty -each 'rmapshaperid = this.id' -o C:\Users\TIM~1.APP\AppData\Local\Temp\RtmpITMI68\file107020a34084.geojson' had status 1
Session info
> devtools::session_info()
Session info ----------------------------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.4 (2018-03-15)
 system   x86_64, mingw32             
 ui       RStudio (1.1.442)           
 language (EN)                        
 collate  German_Germany.1252         
 tz       Europe/Berlin               
 date     2018-04-18                  

Packages --------------------------------------------------------------------------------------------------------------------------------------------
 package      * version    date       source                            
 abind          1.4-5      2016-07-21 CRAN (R 3.4.1)                    
 assertthat     0.2.0      2017-04-11 CRAN (R 3.4.0)                    
 base         * 3.4.4      2018-03-15 local                             
 base64enc      0.1-3      2015-07-28 CRAN (R 3.4.0)                    
 bindr          0.1        2016-11-13 CRAN (R 3.4.1)                    
 bindrcpp       0.2        2017-06-17 CRAN (R 3.4.1)                    
 class          7.3-14     2015-08-30 CRAN (R 3.4.4)                    
 classInt       0.1-24     2017-04-16 CRAN (R 3.4.0)                    
 codetools      0.2-15     2016-10-05 CRAN (R 3.4.4)                    
 colorspace     1.3-2      2016-12-14 CRAN (R 3.4.0)                    
 compiler       3.4.4      2018-03-15 local                             
 crosstalk      1.0.0      2016-12-21 CRAN (R 3.4.0)                    
 curl           3.1        2017-12-12 CRAN (R 3.4.3)                    
 datasets     * 3.4.4      2018-03-15 local                             
 DBI            0.7        2017-06-18 CRAN (R 3.4.1)                    
 devtools       1.13.2     2017-06-02 CRAN (R 3.4.1)                    
 digest         0.6.12     2017-01-27 CRAN (R 3.4.0)                    
 dplyr          0.7.4      2017-09-28 CRAN (R 3.4.2)                    
 e1071          1.6-8      2017-02-02 CRAN (R 3.4.0)                    
 foreach        1.4.3      2015-10-13 CRAN (R 3.4.0)                    
 foreign        0.8-69     2017-06-22 CRAN (R 3.4.4)                    
 gdalUtils      2.0.1.7    2015-10-10 CRAN (R 3.4.0)                    
 geojson        0.2.0      2017-11-08 CRAN (R 3.4.4)                    
 geojsonio      0.6.0      2018-03-30 CRAN (R 3.4.4)                    
 geojsonlint    0.2.0      2016-11-03 CRAN (R 3.4.1)                    
 glue           1.2.0      2017-10-29 CRAN (R 3.4.3)                    
 graphics     * 3.4.4      2018-03-15 local                             
 grDevices    * 3.4.4      2018-03-15 local                             
 grid           3.4.4      2018-03-15 local                             
 htmltools      0.3.6      2017-04-28 CRAN (R 3.4.0)                    
 htmlwidgets    1.0        2018-01-20 CRAN (R 3.4.3)                    
 httpuv         1.3.5      2017-07-04 CRAN (R 3.4.3)                    
 httr           1.3.1      2017-08-20 CRAN (R 3.4.3)                    
 iterators      1.0.8      2015-10-13 CRAN (R 3.4.0)                    
 jqr            1.0.0      2017-09-28 CRAN (R 3.4.4)                    
 jsonlite       1.5        2017-06-01 CRAN (R 3.4.3)                    
 jsonvalidate   1.0.0      2016-06-13 CRAN (R 3.4.1)                    
 lattice        0.20-35    2017-03-25 CRAN (R 3.4.4)                    
 lazyeval       0.2.1      2017-10-29 CRAN (R 3.4.2)                    
 leaflet        1.1.0.9000 2018-04-03 Github (rstudio/leaflet@d489e2c)  
 magrittr       1.5        2014-11-22 CRAN (R 3.4.0)                    
 maptools       0.9-2      2017-03-25 CRAN (R 3.4.0)                    
 mapview      * 2.3.13     2018-04-12 Github (r-spatial/mapview@e3f3faa)
 memoise        1.1.0      2017-04-21 CRAN (R 3.4.0)                    
 methods      * 3.4.4      2018-03-15 local                             
 mime           0.5        2016-07-07 CRAN (R 3.4.0)                    
 munsell        0.4.3      2016-02-13 CRAN (R 3.4.0)                    
 pillar         1.2.1      2018-02-27 CRAN (R 3.4.3)                    
 pkgconfig      2.0.1      2017-03-21 CRAN (R 3.4.1)                    
 plyr           1.8.4      2016-06-08 CRAN (R 3.4.0)                    
 png            0.1-7      2013-12-03 CRAN (R 3.4.0)                    
 R.methodsS3    1.7.1      2016-02-16 CRAN (R 3.4.0)                    
 R.oo           1.21.0     2016-11-01 CRAN (R 3.4.0)                    
 R.utils        2.5.0      2016-11-07 CRAN (R 3.4.0)                    
 R6             2.2.2      2017-06-17 CRAN (R 3.4.1)                    
 raster         2.6-7      2017-11-13 CRAN (R 3.4.3)                    
 Rcpp           0.12.14    2017-11-23 CRAN (R 3.4.2)                    
 rgdal          1.2-15     2017-10-23 local                             
 rgeos          0.3-23     2017-04-06 CRAN (R 3.4.0)                    
 rlang          0.2.0      2018-02-20 CRAN (R 3.4.3)                    
 rmapshaper   * 0.4.0      2018-04-03 CRAN (R 3.4.4)                    
 satellite      1.0.1      2017-10-18 CRAN (R 3.4.2)                    
 scales         0.5.0      2017-08-24 CRAN (R 3.4.2)                    
 sf           * 0.6-0      2018-01-06 CRAN (R 3.4.3)                    
 shiny          1.0.5      2017-08-23 CRAN (R 3.4.3)                    
 sp             1.2-7      2018-01-19 CRAN (R 3.4.4)                    
 stars          0.0        2018-01-08 Github (r-spatial/stars@1844f0d)  
 stats        * 3.4.4      2018-03-15 local                             
 stats4         3.4.4      2018-03-15 local                             
 tibble         1.4.2      2018-01-22 CRAN (R 3.4.3)                    
 tools          3.4.4      2018-03-15 local                             
 udunits2       0.13       2016-11-17 CRAN (R 3.4.0)                    
 units          0.4-6      2017-08-27 CRAN (R 3.4.1)                    
 utils        * 3.4.4      2018-03-15 local                             
 V8             1.5        2017-04-25 CRAN (R 3.4.1)                    
 viridisLite    0.3.0      2018-02-01 CRAN (R 3.4.4)                    
 webshot        0.5.0      2017-11-29 CRAN (R 3.4.3)                    
 withr          2.1.0.9000 2017-11-30 Github (jimhester/withr@fe81c00)  
 xtable         1.8-2      2016-02-05 CRAN (R 3.4.0)                    
 yaml           2.1.14     2016-11-12 CRAN (R 3.4.0) 
@ateucher
Copy link
Owner

Thanks @tim-salabim. This is only on your Windows machine? What version of mapshaper do you have installed? (system("mapshaper --version"))

@tim-salabim
Copy link
Author

mapshaper version is 0.4.64. I can test tonite on my linux machine and see if I have the same issue there.

@ateucher
Copy link
Owner

ateucher commented Apr 19, 2018

Can you try the on the command line?

library(sf)
library(mapview)
st_write(franconia, "franconia.geojson")

Then in the terminal:

$ mapshaper franconia.geojson snap -simplify 0.05  weighting=0.7 -filter remove-empty -each 'rmapshaperid = this.id' -o foo.geojson

@tim-salabim
Copy link
Author

Same error. But when we remove the spaces in 'rmapshaperid = this.id' to become 'rmapshaperid=this.id' it works. Should be an easy fix...

unbenannt

@ateucher
Copy link
Owner

Oh of course! Thanks @tim-salabim - I'll push up a change and perhaps you can test for me?

@tim-salabim
Copy link
Author

Thanks! I'll test on monday

@tim-salabim
Copy link
Author

Thanks! Works as expected now

unbenannt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants