rossjs / largest-rect-in-poly-geojson

An attempt to improve upon the utility and effectiveness of largest-rect-in-poly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Largest Rectangle In Polygon

Return the largest rectangle contained in a polygon (now with helpful geojson input/outputs).

Based on socialtables/largest-rect-in-poly, which was based on d3plus.

Built on d3 and simplify-js.

API

largestRectInPoly(polygon[, options])

poly

options

{
  maxAspectRatio:  , // maximum aspet ratio for rectangle
  minWidth:  , // minimum width for rectangle
  minHeight:  , // maximum height for rectangle
  tolerance:  , //
  nTries: Number, // number of randomized points to run the algorithm on
  angle:  , // required orientation of rectangle (if needed)
  aspectRatio:  , //
  origin:  , //
  output: String, // the output format (only accepts 'geojson' right now)
  compare: Boolean, // whether or not to add highlighted rectangle to geojson output that inlcudes original geometry
}

About

An attempt to improve upon the utility and effectiveness of largest-rect-in-poly

License:MIT License


Languages

Language:JavaScript 100.0%