Geographic Information Systems Asked on January 22, 2021
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:Pythonbuffer.shp"
output_shp = r"C:Pythonresult.shp"
input_shp = r'C:Pythondata.shp'
subprocess.call(["ogr2ogr", "-f", "ESRI Shapefile", "-clipsrc", clipping_shp, output_shp, input_shp], shell=True)
Which algorithm does QGIS use for clipping shapefiles?
QGIS is Open Source and you can have a look through the code for the clipping algorithm on their GitHub:
Answered by HeikkiVesanto on January 22, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP