[R-sig-Geo] Long time to load shapefiles

GD grothered at gmail.com
Thu Oct 17 05:55:33 CEST 2013


Hi Phil,

I have also found readOGR to be very slow when reading a large shapefile (in
my case, a shapefile with 85000 polygons and ~ 200 columns in the attribute
table).

In my case, I would repeatedly re-read the shapefile each time I was working
on the script. 

To speed things up, I found it best to use readOGR to get the file into R
the first time, but then save the resulting object as an RDS file (using
saveRDS). From then on, you can load the object with readRDS. In my case,
that would happen in about 10s, whereas it might take 20min for readOGR to
directly read the shapefile. 

Cheers,
Gareth.   



--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Long-time-to-load-shapefiles-tp7584869p7584873.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list