I have a few random points that I generated within a polygon. I randomly selected one of the points and would like to buffer that point. In the case below, buffering will be applied to all points and not the selected point.
Do I need to create a new memory layer of the selected point first? If so, how?
#Generating random points within an "aoi" polygon file
pnts = processing.runAndLoadResults("native:randompointsinpolygons", {
'INPUT': aoi,
'POINTS_NUMBER': 10,
'MIN_DISTANCE': 0,
'MIN_DISTANCE_GLOBAL': 0,
'MAX_TRIES_PER_POINT': 10,
'SEED': None,
'INCLUDE_POLYGON_ATTRIBUTES': True,
'OUTPUT': 'memory:'
})
#Randomly Choose one of the Points
processing.run("qgis:randomselection", {
'INPUT': pnts['OUTPUT'],
'METHOD': 0,
'NUMBER':1
})
#Buffering the point
pnt_buf = processing.runAndLoadResults("native:buffer", {
'INPUT':pnts,
'DISTANCE':3000,
'SEGMENTS':6,
'END_CAP_STYLE':0,
'JOIN_STYLE':1,
'MITER_LIMIT':3,
'DISSOLVE':True,
'SEPARATE_DISJOINT':False,
'OUTPUT':'memory:'
})