Saturday, 31 December 2016

How can I work with very large shapefiles (~1 GB) in QGIS?



I'm performing some basic spatial analyses on a large database of traffic injuries in California between 2003 - 2011. Because the dataset is large (nearly 1 GB of points), I'd like to first cut it down to a specific geographic region using a spatial query, but I find that QGIS consistently freezes and hangs if I try to use a spatial query or filter the layer.


What are some ways I can work with this dataset? Are there more efficient data formats I can use?



Answer



Load the data into SpatiaLite in QGIS... best way is to create a new SpatiaLite database via the right-click GUI in the browser window, then simply drag and drop your shapefile onto the SpatiaLite database you just created.


From there you have all the power of SpatiaLite at your disposal, including SQL and SQL Spatial functions, which are a way more intuitive way to work with this kind of data.


Some more documentation can be found here, and there's the SpatiaLite manager plugin.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...