0

I have a program that (over a period of 60s) generates reachable volumes at 1s intervals and creates a reachable square at each second as a lat/lon array.

What I need to do is, using this series of 60 rectangles, is generate a single polygon such that all corners of all rectangles exist within that polygon and it covers the least area (the magenta line would be the example in the attached figure).

On approach I thought of would be, for all points in all rectangles, see if those points exist in any other rectangle. If they do then remove that point. Although I am unsure how to then order the remaining points to get a nice single polygon.

The array I have to play with is in the shape: (60, 4, 2)

A series of rectangles where all the outer edges have been highlighted in magenta.

Ellis Thompson
  • 408
  • 6
  • 18
  • 1
    this post may help. Your result is likely going to be a non-convex polygon, so `alphashape` might be an approach. https://stackoverflow.com/questions/32267100/find-the-area-of-a-bounding-polygon-that-encloses-a-set-of-points – AirSquid Aug 10 '22 at 18:28
  • Even worse, the result might even be a polygon with interior holes. Imagine moving the box in a circle. – jsb Aug 12 '22 at 09:19

0 Answers0