3.0.12 • Published 8 years ago

turf-envelope v3.0.12

Weekly downloads
11,507
License
MIT
Repository
github
Last release
8 years ago

turf-envelope

build status

turf envelope module

turf.envelope(fc)

Takes a Feature or FeatureCollection and returns a rectangular Polygon feature that encompasses all vertices.

Parameters

parametertypedescription
fcFeatureCollectiona FeatureCollection of any type

Example

var fc = turf.featurecollection([
 turf.point([-75.343, 39.984], {name: 'Location A'}),
 turf.point([-75.833, 39.284], {name: 'Location B'}),
 turf.point([-75.534, 39.123], {name: 'Location C'})
]);

var enveloped = turf.envelope(fc);

var result = turf.featurecollection(
	fc.features.concat(enveloped));

//=result

Installation

Requires nodejs.

$ npm install turf-envelope

Tests

$ npm test