Can we create a buffer of distance 0.004 using python in qgis.
I tried Buffering in pyQGIS?, but it isn't working for python in qgis 2.10.1-Pisa.
The above is the diagram of buffer I am asking. It's located in the vector->geoprocessing tools->Buffer(s)
Any of you could help me out with the equivalent python code for the above Buffer in QGIS.
code:
from qgis.utils import iface from qgis.analysis import QgsGeometryAnalyzer QgsApplication.initQgis() uri = QgsDataSourceURI() uri.setConnection("localhost","5432","gis_data","postgres","password") uri.setDataSource("schema_name","table_name","wkt","") vlayer = QgsVectorLayer(uri.uri(),"LayerName1","postgres") QgsMapLayerRegistry.instance().addMapLayer(vlayer) mc = iface.mapCanvas() layer = mc.currentLayer() QgsGeometryAnalyzer().buffer(layer, "file:///C:/Users/***/Downloads/aa.shp", 0.0004, False, False, -1) Everything works fine till the LayerName1 loads and getting errot at Buffer statement the last line of code error:
Feature geometry not imported (OGR error: Pointer 'hGeom' is NULL in 'OGR_G_ImportFromWkb'. )
