geojson-bounding-box

0.2.0 • Public • Published

geojson-bounding-box

build coverage npm code

Efficiently computes a GeoJSON's bounding box using a generator to traverse its coordinates.

GETTING STARTED

Install

npm install --save geojson-bounding-box

Example

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:

npm install
npm test

LICENSE

Copyright (c) 2019 Daniel Pulido mailto:dpmcmlxxvi@gmail.com

Source code is released under the MIT License.

/geojson-bounding-box/

    Package Sidebar

    Install

    npm i geojson-bounding-box

    Weekly Downloads

    283

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    9.68 kB

    Total Files

    6

    Last publish

    Collaborators

    • dpmcmlxxvi