I'm trying to create a contour around polygons. I already managed to convert the polygons to lines and now I am trying to use SQLite and the ogr2ogr command to give them thickness. From online tutorials I gathered that

ogr2ogr -dialect SQLite -sql "SELECT ST_Buffer(GEOMETRY, 0.1) as geometry FROM lines" lines-buffered.shp lines.shp

should give me borders with a thickness of 0.1 in the current projection (which is Robinson ESRI:54030, whatever unit that translates to). I actually don't care that much about the exact thickness (I'd be fine with trial and error). Any hints what I'm doing wrong? When I'm looking at the resulting lines-buffered.shp in QGIS it does not seem to have thickness.


1 Answer 1


Not sure if you are suffering a misconception here. Apologice if it's not the case.

You should not use a buffer to make a line "thicker". If you buffer a line you will get a polygon. If you want to change how a line, or any other geometry is represented use the appropriate symbology in the tools that you are using to visualize the data.

Also, AFAIK, Robinson ESRI:54030 uses meters as unit. So when you buffer with a 0.1, it means that you are making a buffer of 0.1m. Difficult to see the difference most of the time.

  • Hi, thank you for the help, unfortunately I didn't get the notice. Yes, creating polygons around the lines was exactly what I wanted to rasterize them 'thicker'. And your comment about Robinson using meters as unit solved the issue! Since you say it would be better to change how geometry is represented instead of buffering, is that possible using the gdal_rasterize command or any other gdal command?
    – paul maier
    Sep 27 at 8:10

Your Answer

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

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