My task is to generate a box that maps over the existing polygon, which I’ll call the level. What I’m doing is mapping buildings with geojson, which does so by using a set of lat/long coordinates as points to define the polygon that matches the walls.
To create the box, I currently have a script in place to find the furthest coordinates (on the level) in North/South/east/West directions. It then generates a line with those two coordinates and finds the intersection between the line in each direction. Essentially boxing in the entire level no matter what funky shape the building is in.
However, this only works when the building directly faces a cardinal direction. My question is, when the building is instead facing X degrees in a certain direction, how can I perform the same calculation that will generate the box for me?