aparshin / turf-buffer

Buffers a point, linestring, or polygon Feature/FeatureCollection to a given radius. Units supported are miles, kilometers, and degrees.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

turf-buffer

build status

turf buffer module

turf.buffer(feature, distance, unit)

Calculates a buffer for a Point, LineString, or Polygon Feature/FeatureCollection for a given radius. Units supported are miles, kilometers, and degrees.

Parameters

parameter type description
feature FeatureCollection a Feature or FeatureCollection of any type
distance Number distance to draw the buffer
unit String 'miles' or 'kilometers'

Example

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

Installation

Requires nodejs.

$ npm install turf-buffer

Tests

$ npm test

About

Buffers a point, linestring, or polygon Feature/FeatureCollection to a given radius. Units supported are miles, kilometers, and degrees.

License:MIT License


Languages

Language:JavaScript 100.0%