Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
tcql committed Feb 17, 2015
1 parent b941034 commit 2d3b1ed
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,33 @@ Calculates a buffer for a Point, LineString, or Polygon Feature/FeatureCollectio

### 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' |
| parameter | type | description |
| ---------- | ----------------- | ----------------------------------------------------- |
| `feature` | FeatureCollection | a Feature or FeatureCollection of any type |
| `distance` | Number | distance to draw the buffer |
| `unit` | String | 'miles', 'feet', 'kilometers', 'meters', or 'degrees' |


### Example

```js
var pt = turf.point([-90.548630, 14.616599]);
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.features.concat(pt));
var resultFeatures = buffered.features.concat(pt);
var result = {
"type": "FeatureCollection",
"features": resultFeatures
};

//=result
```
Expand All @@ -47,3 +57,4 @@ $ npm install turf-buffer
$ npm test
```


0 comments on commit 2d3b1ed

Please sign in to comment.