I'm trying to create a one-sided buffer from a polyline shapefile using ogr2ogr command line and a virtual file. However, it only creates a .dbf file and not the shapefiles. Here's the code:

ogr2ogr -sql "SELECT ST_Buffer(A.geometry,50, 'right') AS geometry, A.* FROM Polyline A" -dialect SQLITE Buffer.shp input.vrt

I have to mention that this code works fine when not putting the 'right' or 'left' parameters.

Any ideas?

1 Answer 1


I think for spatialite you can use ST_SingleSidedBuffer instead.

It's listed in the spatialite help under GEOS Specific Features, http://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html#p14b

from the docs:

ST_SingleSidedBuffer( geom Curve , radius Double precision , left_or_right Integer ) : Curve

It's mentions that the linestring has to be non-closed too.

  • Thanks for your reply @SaultDon. But where do I have to assign input, output and buffer distance in this code?
    – Mehdi
    Apr 4, 2017 at 5:01
  • Very much alike that you had with ST_Buffer. What have you tried?
    – user30184
    Apr 4, 2017 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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