I am trying to automate a process with inputs of:
- Multipart polygon geometry
- Four points - which are the actual center points of the four small rectangles within the larger polygon
How can I move the polygon to align with the four points using PyQGIS?
My first attempt was to start with the center points and construct the polygons around them, calculating the orientation of the points and rotating the polygons accordingly, but I'll be receiving different polygons (with varying complexity) and hard-coding the dimensions will be too cumbersome. My next thought is to calculate centroids of those inner rectangles, but then I don't know how to snap them to the actual center points. This is where you all come in.