[GIS] Large Shapefiles in R

qgisrshapefileusgs

I would like to work with the USGS dataset PADUS in R. However the files are huge and I just want to plot out the main state and national forests, parks and protected areas. Does anyone have any suggestion on how to load and plot these very large files?
USGS DATA DOWNLOAD

Normally I would use readOGR (rgdal) to load in the files but this just seems to crash or fail to load.

Best Answer

Use "x <- sf::st_read" it's much faster than rgdal and will happily read much larger data sets.

When you plot it, be sure to use "plot (st_geometry(x))" first, since it will otherwise do a lot of repeated drawing for the default multi panel layout. It defaults to faceting on every column, up to some max.

Indexing with "[" works the same as with sp, so use that to plot just a few rows before trying the entire thing if it's really massive.

Related Question