1

I have a polygon drawn on the map canvas.Say the polygon would be drawn by using "Measure Area" tool in qgis.Now, I want to do buffer for certain distance around that polygon.I can see the below operation in QGIS in which it uses a layer as input parameter instead i want the polygon as an input in the buffer.How should this be accomplished in QGIS using python.

processing.runalg("qgis:fixeddistancebuffer","layer-name-you-need",0.1,10,False,"Path-to-file-to-store")

enter image description here

2

The Measure area tool does not create a layer which can be input for Processing. You need to create a new polygon layer, for example a Memory layer, see

http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/vector.html#memory-provider

and

Using in-memory vector layer with QGIS processing / SEXTANTE

|improve this answer|||||
  • 1
    Thank you for the response. But still You can understand from the image which i added recently. From the image, if i exported the polygon as a memory layer and give it as a input for buffer it would be impossible to find the cities around the polygon.since, it will consider only the memory layer and not the original layer.I Am just curious whether for the above scenario the memory layer works? – User123 Feb 28 '15 at 11:50
  • Sorry I don't follow. The original question only concerned how to buffer a polygon. Selecting the cities inside the polygon is a completely different issue! – underdark Feb 28 '15 at 12:13
  • 1
    Still it should not select cities inside the polygon, it should create a buffer around that boundary(polygon) of certain distance. – User123 Feb 28 '15 at 14:19
  • Sorry, I don't understand your point – underdark Feb 28 '15 at 15:42

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.