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
1 Answer 1
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
-
1Thank 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– User1232015年02月28日 11:50:12 +00:00Commented 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!underdark– underdark2015年02月28日 12:13:14 +00:00Commented Feb 28, 2015 at 12:13
-
1Still it should not select cities inside the polygon, it should create a buffer around that boundary(polygon) of certain distance.User123– User1232015年02月28日 14:19:10 +00:00Commented Feb 28, 2015 at 14:19
-
Sorry, I don't understand your pointunderdark– underdark2015年02月28日 15:42:03 +00:00Commented Feb 28, 2015 at 15:42