Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 1.58 KB

File metadata and controls

46 lines (29 loc) · 1.58 KB

turf-buffer

Code to buffer a simple feature geometry (without JSTS dependancy!).

This code was branched from the old turf-buffer (now at @turf/buffer) and implements a geodesic buffer. The details are explained in this PR.

Turf buffer module

This code is not on npm. Therefore, you'll have to download this directory, name it turf-buffer and put it in the node_modules directory of you projected.

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 buffer = require('turf-buffer')

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

var buffered = buffer(pt, 10, 'miles')

// result