https://github.com/dpmcmlxxvi/geojson-bounding-box
Efficiently computes a GeoJSON's bounding box.
https://github.com/dpmcmlxxvi/geojson-bounding-box
algorithm bounding box extents geojson geospatial gis
Last synced: 21 days ago
JSON representation
Efficiently computes a GeoJSON's bounding box.
- Host: GitHub
- URL: https://github.com/dpmcmlxxvi/geojson-bounding-box
- Owner: dpmcmlxxvi
- License: mit
- Created: 2019-06-07T05:01:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-11T21:02:09.000Z (almost 4 years ago)
- Last Synced: 2025-03-25T07:36:07.395Z (about 1 month ago)
- Topics: algorithm, bounding, box, extents, geojson, geospatial, gis
- Language: JavaScript
- Size: 378 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# geojson-bounding-box
[](https://travis-ci.org/dpmcmlxxvi/geojson-bounding-box)
[](https://coveralls.io/r/dpmcmlxxvi/geojson-bounding-box?branch=master)
[](https://badge.fury.io/js/geojson-bounding-box)
[](https://www.codacy.com/gh/dpmcmlxxvi/geojson-bounding-box/dashboard?utm_source=github.com&utm_medium=referral&utm_content=dpmcmlxxvi/geojson-bounding-box&utm_campaign=Badge_Grade)Efficiently computes a GeoJSON's bounding box using a generator to traverse its
coordinates.## GETTING STARTED
### Install
```bash
npm install --save geojson-bounding-box
```### Example
```javascript
const toBBox = require('geojson-bounding-box');const line = {
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[0, 1], [1, 2], [2, 1]
]
},
"properties": {}
};const bbox = toBBox(line);
// = [0, 1, 2, 2]
```## BUILD
To build and test the library locally:
```shell
npm install
npm test
```## LICENSE
Copyright (c) 2019 Daniel Pulido
Source code is released under the [MIT License](http://opensource.org/licenses/ISC).