In PyQGIS, I kwnow how to draw polygons starting from a list of points which represent the nodes of the shape. An example of list could be this:
# First polygon list_1 = [QgsPoint(0,0),QgsPoint(0,50),QgsPoint(50,50),QgsPoint(50,0)] # Second polygon list_2 = [QgsPoint(10,10),QgsPoint(10,30),QgsPoint(30,30),QgsPoint(30,20)]
which lead to the representation of these polygons:
If I manually do some operations, I can create a unique polygon like this one:
My question is: Is there a specific rule or a particular way to handle points (in or outside a list) for obtaining the result above? I only know that, for simple polygons, the points must to be ordered clockwise.
My goal is similar to that one in this question, but I think that the context is different here.