Dear list
I am searching alternatives to ESRI shapefiles for the storage of GPS data,
i.e. tagged point features, and came across SpatialLite or Geopackage.
Unfortunately writing to both formats is very slow compared to shapefiles
making practical use impossible.
library(sf)
library(rgdal)
library(RSQLite)
n<- 1000
d <-data.frame(a=1:n, X=rnorm(n,1,1), Y=rnorm(n,1,1))
mp1 <- st_as_sf(d, coords=c("X","Y"))
t1 <- system.time(st_write(mp1, dsn = 'C:/Temp/data1.shp', driver = 'ESRI
Shapefile'))
t2 <- system.time(st_write(mp1, dsn = 'C:/Temp/test.sqlite', layer = 'data1',
driver = 'SQLite'))
t3 <- system.time(st_write(mp1, "C:/Temp/data1.gpkg"))
rbind(t1,t2,t3)[,1:3]
user.self sys.self elapsed
t1 0.03 0.03 0.09
t2 0.53 5.04 29.33
t3 0.48 4.29 32.19
As n increases, processing time explodes for SpatialLite and Geopackage, and I
usually have a couple of 10000 points to store. Any experiences of others would
be highly appreciated.
Many thanks
Manuel
------
R version 3.4.1 (2017-06-30)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252
[3] LC_MONETARY=German_Switzerland.1252 LC_NUMERIC=C
[5] LC_TIME=German_Switzerland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] sf_0.5-3 RSQLite_2.0 rgdal_1.2-8 sp_1.2-5
loaded via a namespace (and not attached):
[1] Rcpp_0.12.12 lattice_0.20-35 digest_0.6.12 grid_3.4.1 DBI_0.7
[6] magrittr_1.5 units_0.4-5 rlang_0.1.2 blob_1.1.0
tools_3.4.1
[11] udunits2_0.13 bit64_0.9-7 bit_1.1-12 compiler_3.4.1
memoise_1.1.0
[16] tibble_1.3.4
_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo