2

Does anyone know if there is an R package out there with an algorithm which finds the largest rectangle within non-convex polygons? I have Googled, searched the R Sig Geo archives, and looked here on GIS Stackexchange to no avail.

Here is an example of the type of output I am looking for:

This image comes from this blog post which showcases the type of algorithm that would be useful for my project. Unfortunately for me, that algorithm is written in coffeescript and I do not have the time to spend recreating it in R.

Glorfindel
  • 1,096
  • 2
  • 9
  • 14
Tiernan
  • 396
  • 1
  • 12
  • The related threads at http://gis.stackexchange.com/questions/60755, http://gis.stackexchange.com/questions/27303, and http://gis.stackexchange.com/questions/32552 might be of interest. Please note that the referenced algorithm is approximate: it performs a grid search over the range of possible orientations of the rectangle. This means the part you need to worry about is the simpler problem of maximizing a rectangle of a given orientation. – whuber Apr 13 '16 at 16:17
  • If you can't find an appropriate R script, maybe this blog will help you utilizeCoffescript/js in R. https://cran.r-project.org/web/packages/js/vignettes/intro.html – klewis Apr 13 '16 at 20:40

0 Answers0