# geojson-minimum-bounding-rectangle **Repository Path**: daddybod/geojson-minimum-bounding-rectangle ## Basic Information - **Project Name**: geojson-minimum-bounding-rectangle - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-20 - **Last Updated**: 2021-07-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![npm version](https://badge.fury.io/js/geojson-minimum-bounding-rectangle.svg)](https://badge.fury.io/js/geojson-minimum-bounding-rectangle) # Minimum Bounding Rectangle for GeoJSON This Javascript/Typescript library provides 2 methods for calculating the Minimum Bounding Rectangle by area and by width for a given GeoJSON feature or feature collection. This problem it is solving has many names: Minimum Bounding Rectangle, Minimum Bounding Box, Smallest Surrounding Rectangle, Minimum Area Rectangle... ## Example This is an example of the output of this library. The input GeoJSON is the yellow polygon (outline of the Republic of Ireland). The blue rectangle was generated by ` smallestSurroundingRectangleByWidth` while the red rectangle is the output of ` smallestSurroundingRectangleByArea` ![example image](https://raw.githubusercontent.com/matthiasfeist/geojson-minimum-bounding-rectangle/main/docs/img/example.png) ## How to use it ### Installation ```sh yarn add geojson-minimum-bounding-rectangle ``` or ```sh npm install geojson-minimum-bounding-rectangle ``` ### Usage ```ts import { smallestSurroundingRectangleByWidth, smallestSurroundingRectangleByArea, } from "geojson-minimum-bounding-rectangle"; const boundingRect = smallestSurroundingRectangleByWidth(myGeoJsonInput); ``` ## More Information: - https://en.wikipedia.org/wiki/Minimum_bounding_box_algorithms - https://gis.stackexchange.com/questions/22895/finding-minimum-area-rectangle-for-given-points ## License See [LICENSE](https://github.com/matthiasfeist/geojson-minimum-bounding-rectangle/blob/main/LICENSE) for more details.