I have a script which has an unrelated error after the
draw_polygon function. I don't care about the error at the moment because I want to see the current results. For some reason my draw function doesn't work. My thought was that the drawing of
QgsRubberBand happens after the succesful completion of a function?
def draw_polygon(Polypoints): point = QgsVertexMarker(canvas) poly = QgsRubberBand(canvas, True) poly_points =  for feature in Polypoints: point.setCenter(QgsPoint(feature, feature)) point.setColor(QColor(255, 150, 0)) point.setIconSize(20) poly_points.append(QgsPoint(feature, feature)) poly.setToGeometry(QgsGeometry.fromPolygon([poly_points]), None) poly.setColor(QColor(0, 150, 150)) poly.setWidth(3)
I am using QGIS 2.18.