Skip to content

Writing a large gpkg file taking forever #1409

Closed
@Robinlovelace

Description

@Robinlovelace

I'm trying to write a large (300 ~600 MB as .Rds) file to disk. It saved in about 5 minutes in the .Rds format and took around 10 minutes to read in from a load of compressed .gml file using this mini package developed for the job: https://github.com/ITSLeeds/mastermapr

sf::write_sf(mm_highway_uk, "destination.gpkg")

Has been running for over an hour now and am wondering if it will ever finish! I know this is likely to be an issue upstream with GDAL but I'm raising the issue here in case others have had similar issues and in case it's of use. It's related to wider question of which geographic file format to save data as.

This is my set-up:

library(sf)
#> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 7.0.0

Created on 2020-05-28 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.6.3 (2020-02-29)
#>  os       Ubuntu 18.04.4 LTS          
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language en_GB:en                    
#>  collate  en_GB.UTF-8                 
#>  ctype    en_GB.UTF-8                 
#>  tz       Europe/London               
#>  date     2020-05-28                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version    date       lib source                             
#>  assertthat    0.2.1      2019-03-21 [2] CRAN (R 3.6.0)                     
#>  backports     1.1.7      2020-05-13 [1] CRAN (R 3.6.3)                     
#>  callr         3.4.3      2020-03-28 [1] CRAN (R 3.6.3)                     
#>  class         7.3-17     2020-04-26 [2] CRAN (R 3.6.3)                     
#>  classInt      0.4-3      2020-04-06 [1] Github (r-spatial/classInt@d024051)
#>  cli           2.0.2      2020-02-28 [1] CRAN (R 3.6.2)                     
#>  crayon        1.3.4      2017-09-16 [2] standard (@1.3.4)                  
#>  DBI           1.1.0      2019-12-15 [2] CRAN (R 3.6.2)                     
#>  desc          1.2.0      2018-05-01 [2] standard (@1.2.0)                  
#>  devtools      2.3.0      2020-04-10 [1] CRAN (R 3.6.3)                     
#>  digest        0.6.25     2020-02-23 [1] CRAN (R 3.6.2)                     
#>  e1071         1.7-3      2019-11-26 [2] CRAN (R 3.6.1)                     
#>  ellipsis      0.3.1      2020-05-15 [3] CRAN (R 3.6.3)                     
#>  evaluate      0.14       2019-05-28 [2] CRAN (R 3.6.0)                     
#>  fansi         0.4.1      2020-01-08 [1] CRAN (R 3.6.2)                     
#>  fs            1.4.1      2020-04-04 [2] CRAN (R 3.6.3)                     
#>  glue          1.4.1      2020-05-13 [2] CRAN (R 3.6.3)                     
#>  highr         0.8        2019-03-20 [3] CRAN (R 3.5.3)                     
#>  htmltools     0.4.0.9003 2020-04-09 [1] Github (rstudio/htmltools@1a7d0dc) 
#>  KernSmooth    2.23-17    2020-04-26 [4] CRAN (R 3.6.3)                     
#>  knitr         1.28       2020-02-06 [1] CRAN (R 3.6.2)                     
#>  magrittr      1.5        2014-11-22 [2] CRAN (R 3.5.2)                     
#>  memoise       1.1.0      2017-04-21 [3] CRAN (R 3.5.0)                     
#>  pkgbuild      1.0.8      2020-05-07 [1] CRAN (R 3.6.3)                     
#>  pkgload       1.0.2      2018-10-29 [3] CRAN (R 3.5.1)                     
#>  prettyunits   1.1.1      2020-01-24 [1] CRAN (R 3.6.2)                     
#>  processx      3.4.2      2020-02-09 [1] CRAN (R 3.6.3)                     
#>  ps            1.3.3      2020-05-08 [1] CRAN (R 3.6.3)                     
#>  R6            2.4.1      2019-11-12 [2] CRAN (R 3.6.1)                     
#>  Rcpp          1.0.4.6    2020-04-09 [1] CRAN (R 3.6.3)                     
#>  remotes       2.1.1      2020-02-15 [1] CRAN (R 3.6.2)                     
#>  rlang         0.4.6.9000 2020-05-05 [1] Github (r-lib/rlang@4bea875)       
#>  rmarkdown     2.1.2      2020-04-09 [1] Github (rstudio/rmarkdown@65dd144) 
#>  rprojroot     1.3-2      2018-01-03 [2] CRAN (R 3.5.3)                     
#>  rstudioapi    0.11       2020-02-07 [2] CRAN (R 3.6.2)                     
#>  sessioninfo   1.1.1      2018-11-05 [3] CRAN (R 3.5.1)                     
#>  sf          * 0.9-3      2020-05-04 [1] CRAN (R 3.6.3)                     
#>  stringi       1.4.6      2020-02-17 [1] CRAN (R 3.6.2)                     
#>  stringr       1.4.0      2019-02-10 [2] standard (@1.4.0)                  
#>  testthat      2.3.2      2020-03-02 [1] CRAN (R 3.6.3)                     
#>  units         0.6-6      2020-03-16 [1] CRAN (R 3.6.3)                     
#>  usethis       1.6.1      2020-04-29 [1] CRAN (R 3.6.3)                     
#>  withr         2.2.0      2020-04-20 [2] CRAN (R 3.6.3)                     
#>  xfun          0.14       2020-05-20 [1] CRAN (R 3.6.3)                     
#>  yaml          2.2.1      2020-02-01 [1] CRAN (R 3.6.2)                     
#> 
#> [1] /home/robin/R/x86_64-pc-linux-gnu-library/3.6
#> [2] /usr/local/lib/R/site-library
#> [3] /usr/lib/R/site-library
#> [4] /usr/lib/R/library

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions