turf-size

turf size module


Keywords
turf, size, bbox, shape, geojson
License
MIT
Install
npm install turf-size@1.1.1

Documentation

turf-size

build status

turf size module

turf.size(bbox, factor)

Takes a bounding box and returns a new bounding box with a size expanded or contracted by a factor of X.

Parameters

parameter type description
bbox Array.<number> a bounding box
factor Number the ratio of the new bbox to the input bbox

Example

var bbox = [0, 0, 10, 10]

var resized = turf.size(bbox, 2);

var features = {
  "type": "FeatureCollection",
  "features": [
    turf.bboxPolygon(bbox),
    turf.bboxPolygon(resized)
  ]
};

//=features

Returns Array.<number>, the resized bbox

Installation

Requires nodejs.

$ npm install turf-size

Tests

$ npm test