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

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Jul 30 19:04:44 CEST 2012


On Mon, Jul 30, 2012 at 5:16 PM,
Bastien.Ferland-Raymond at mrnf.gouv.qc.ca
<Bastien.Ferland-Raymond at mrnf.gouv.qc.ca> wrote:
> Thanks Barry for your interest in my problem.  It is indeed an interesting problem at the same time as a complex one.
>
> I've tried your code and it works for two lakes so far.  It's seems like a very good base for what I want to do.  I'll modify it a little to speed it up.  First by removing the very small lakes, than by changing the loop "for" by a "while" as I just need to find if I can fit or not a rectangle, I don't need the rectangle(s).

 There's an option to my function that you can use to tell it to stop
if it finds it can fit a rectangle - if you pass all=FALSE it returns
as soon as it finds one, otherwise it returns NA.

 I'm not sure how my method will work if there are islands (I assume
you dont want islands in the middle of your landing strip!). It uses
rgeos:gContains for the test, so I think as long as the island is
properly coded as an island it wont consider rectangles with islands.
This needs testing.

> There is already a field telling if you could land of not ("AMERISS") that was found by some old ARCgis coding (ARCinfo and aml, not sure exactly how).  It was a consultant that did this code for us a couple of years ago, now we want to transfer to R, explaining why I have this problem now.  The code was also using iteration, however not random, on rasterized lakes.  I think it would be interesting to compare the result from the 2 techniques.
>
> I'm going to try that this afternoon, and let you know the result.

I had a brief think about how to do this with rasters, but I couldn't
see any advantage, unless there's some neat trick way of eroding parts
of the lake that can't possibly be part of a given rectangle...

Barry



More information about the R-sig-Geo mailing list