In QGIS, I want smooth a shapefile/vector's vertices.

I can use QGIS/processing_toolbox/smooth.

If I want to programmingly achieve this using osgeo/ogr/gdal, which function should I use?

1 Answer 1


Yes, it is absolutely possible using GDAL/OGR through ogr2ogr by using -simplify option. You should pass a <tolerance> value as it is described on their website.

Another way is to use osgeo.ogr.Geometry.Buffer(self, *args, **kwargs) on which supports arguments to control distance and number of segments.

If your shapes are polylines you can use shapely->parallel_offset as well. which has a round option. Good Luck.

  • Smoothing is not the same as simplify. The tool description begins "Smooth This algorithm smooths the geometries in a line or polygon layer. It creates a new layer with the same features as the ones in the input layer, but with geometries containing a higher number of vertices and corners in the geometries smoothed out."
    – user30184
    Oct 19, 2021 at 13:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.