This code adds a QgsPoint to a layer. But how to increase the size of feature ?

layer =  QgsVectorLayer('Point', 'points' , "memory")
pr = layer.dataProvider()
pt = QgsFeature()
point1 = QgsPoint(-4080198.52,1492348.027)

A point is a thing of zero dimensions, and cannot be increased in size. Is it possible you mean 'increase size of point symbol with PyQGIS'? In this case I suggest reading about single symbol renderers in the PyQGIS developer cookbook: http://docs.qgis.org/2.14/de/docs/pyqgis_developer_cookbook/vector.html#single-symbol-renderer

  • i think a buffer can work well but .. i don't know how to create buffer around that point .. i am new to qgis.. any help? – vaibhav Dhiman May 5 '17 at 6:44
  • Since QgsPoint() has no buffer() method you have to first convert it to a QgsGeometry() and buffer this by means of g = QgsGeometry().fromPoint(QgsPoint(1,1)).buffer(10,100). You allready did this step in your code. For buffer() refer to qgis.org/api/… – Jochen Schwarze May 5 '17 at 7:07
  • i didn't get buffer(10,100) – vaibhav Dhiman May 5 '17 at 7:18
  • right, but all the steps before ;-) – Jochen Schwarze May 5 '17 at 9:54

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.