I'm working in QGIS, and my current method to change csvs to shapefiles is to import them to QGIS, right click and save as shapefile. For large CSVs (over 100 million rows) it can take quite some time to save. Is there a quicker, more efficient way to do this? Perhaps using geopandas?

  • 2
    run ogr2ogr, it is installed in the bin folder of your qgis folder. stackoverflow.com/questions/22497541/… – klewis Jan 19 '17 at 16:44
  • How do I create a sample vrt file? – Joshua Kidd Jan 19 '17 at 17:03
  • Do you need to store some data in your final shapefile, or you simply need to create the points (as geometries)? – mgri Jan 19 '17 at 17:21
  • 1
    The vrt file is just a bit of xml, but think of it as a text file. Using the example here: http://gis.stackexchange.com/questions/127518/convert-csv-to-kml-or-geojson-etc-using-ogr2ogr-or-equivalent-command-line-tool you just change the layer name to the base name of your csv file (mycoords.csv to mycoords). Though, this may not be ideal for many points, I'm converting a 1 million record file to shp and its taken at least 20 min and not done. Hasn't crashed though! – Dave-Evans Jan 19 '17 at 17:40
  • 1
    I convert 9 million points from csv to shape with ogr2ogr under Windows in about 5 minutes. Note: The DBF is then > 3 GB. But I think 100 million points are something much for a shapefile. – Mike Jan 20 '17 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.