Which algorithm does QGIS use for clipping shapefiles?
When I use ogr2ogr to clip a large shapefile (approx. 3gb) it takes 77sec. When using QGIS it takes approx 5 sec, clipping the same dataset (and same mask-layer). New clipped layer is approx 30mb, and the 6sec. includes saving in QGIS
Any suggestions for a better algorithms or modifications of the code below?
Here is the code I use in Python:
import subprocess clipping_shp = r"C:\Python\buffer.shp" output_shp = r"C:\Python\result.shp" input_shp = r'C:\Python\data.shp' subprocess.call(["ogr2ogr", "-f", "ESRI Shapefile", "-clipsrc", clipping_shp, output_shp, input_shp], shell=True)