Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turf-bbox

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-bbox

turf bbox module

  • 3.0.10
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

turf-bbox

build status

turf bbox module

turf.bbox(input)

Takes a set of features, calculates the bbox of all input features, and returns a bounding box.

Parameters

parametertypedescription
inputFeature,FeatureCollectioninput features

Example

var input = {
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [114.175329, 22.2524]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [114.170007, 22.267969]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [114.200649, 22.274641]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [114.186744, 22.265745]
      }
    }
  ]
};

var bbox = turf.bbox(input);

var bboxPolygon = turf.bboxPolygon(bbox);

var resultFeatures = input.features.concat(bboxPolygon);
var result = {
  "type": "FeatureCollection",
  "features": resultFeatures
};

//=result

Returns Array.<number>, the bounding box of input given as an array in WSEN order (west, south, east, north)

Installation

Requires nodejs.

$ npm install turf-bbox

Tests

$ npm test

Keywords

FAQs

Package last updated on 15 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc