Skip to content

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

License

Notifications You must be signed in to change notification settings

Turfjs/turf-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED - replaced with @turf/buffer

turf-buffer

build status

turf buffer module

turf.buffer(feature, distance, unit)

Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees.

Parameters

parameter type description
feature Feature,FeatureCollection input to be buffered
distance Number distance to draw the buffer
unit String 'miles', 'feet', 'kilometers', 'meters', or 'degrees'

Example

var pt = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [-90.548630, 14.616599]
  }
};
var unit = 'miles';

var buffered = turf.buffer(pt, 500, unit);
var result = turf.featurecollection([buffered, pt]);

//=result

Returns FeatureCollection.<Polygon>,FeatureCollection.<MultiPolygon>,Polygon,MultiPolygon, buffered features

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published