turf buffer module
Calculates a buffer for a Point, LineString, or Polygon Feature/FeatureCollection for a given radius. Units supported are miles, kilometers, and degrees.
parameter | type | description |
---|---|---|
feature |
FeatureCollection | a Feature or FeatureCollection of any type |
distance |
Number | distance to draw the buffer |
unit |
String | 'miles' or 'kilometers' |
var pt = turf.point([-90.548630, 14.616599]);
var unit = 'miles';
var buffered = turf.buffer(pt, 500, unit);
var result = turf.featurecollection(
buffered.features.concat(pt));
//=result
Requires nodejs.
$ npm install turf-buffer
$ npm test