Skip to content

From Turf-buffer, implementing a native buffer algorithm. Buffers a GeoJSON Feature/FeatureCollection to a given radius.

License

Notifications You must be signed in to change notification settings

mclaeysb/turf-buffer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

From Turf-buffer, implementing a native buffer algorithm. Buffers a GeoJSON Feature/FeatureCollection to a given radius.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%