sf icon indicating copy to clipboard operation
sf copied to clipboard

st_intersection, Replacement has 2 rows, data has 1

Open latot opened this issue 2 years ago • 0 comments

The function intersection give the next error:

a<-readRDS("tmp.RDS")
sf::st_intersection(a$radmins, a$rdata)
Error in `[[<-.data.frame`(`*tmp*`, attr(x, "sf_column"), value = list( : 
  replacement has 2 rows, data has 1

Use the upload file with the code above, this data comes from the OSM, and was unexpected.

The idea of the code I'm working, is intersections and a measure of how much space it intersects in objects of the OSM, and in spheric CRS, not planar., In any case you will see it in the files.

Disable S2 "disables" the error.

> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Gentoo/Linux

Matrix products: default
BLAS:   /usr/lib64/libblas.so.3.10.0
LAPACK: /usr/lib64/liblapack.so.3.10.0

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

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

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8.3       magrittr_2.0.3     units_0.8-0        tidyselect_1.1.2  
 [5] R6_2.5.1           rlang_1.0.2        fansi_1.0.3        s2_1.0.7          
 [9] dplyr_1.0.8        wk_0.6.0           tools_4.0.5        grid_4.0.5        
[13] KernSmooth_2.23-20 utf8_1.2.2         cli_3.2.0          e1071_1.7-9       
[17] DBI_1.1.2          ellipsis_0.3.2     class_7.3-20       assertthat_0.2.1  
[21] tibble_3.1.6       lifecycle_1.0.1    sf_1.0-7           crayon_1.5.1      
[25] purrr_0.3.4        vctrs_0.4.1        glue_1.6.2         proxy_0.4-26      
[29] compiler_4.0.5     pillar_1.7.0       generics_0.1.2     classInt_0.4-3    
[33] pkgconfig_2.0.3 
> sf::sf_extSoftVersion()
          GEOS           GDAL         proj.4 GDAL_with_GEOS     USE_PROJ_H 
      "3.10.0"        "3.4.1"        "8.2.1"         "true"         "true" 
          PROJ 
       "8.2.1"

tmp.zip

latot avatar May 16 '22 15:05 latot