[R-sig-Geo] determining suitable lakes for landing

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Jul 30 17:41:26 CEST 2012


On Mon, Jul 30, 2012 at 1:52 PM, Rowlingson, Barry
<b.rowlingson at lancaster.ac.uk> wrote:

>> Anybody have an idea how to place the rectangle and discriminate those lakes?

To save pasting masses of code in here, I've put a random rectangle
tester in a gist:

https://gist.github.com/3207893

 that does a stupid brute-force approach of trying random NxM
rectangles at random angles all over the polygon until it finds one or
gives up. I reckon any polygon that doesn't get a solution after 5000
trials is probably so horrendous that no pilot would want to land
there anyway...

Barry



More information about the R-sig-Geo mailing list