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

asked Feb 28, 2015 at 7:03

1 Answer 1

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

answered Feb 28, 2015 at 9:32
4
  • 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? Commented Feb 28, 2015 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! Commented Feb 28, 2015 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. Commented Feb 28, 2015 at 14:19
  • Sorry, I don't understand your point Commented Feb 28, 2015 at 15:42

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.