https://github.com/alrico88/shapes-bufferer
Helper classes to add a buffer to a GeoJSON or BBox
https://github.com/alrico88/shapes-bufferer
bbox buffer geojson shape
Last synced: 11 months ago
JSON representation
Helper classes to add a buffer to a GeoJSON or BBox
- Host: GitHub
- URL: https://github.com/alrico88/shapes-bufferer
- Owner: alrico88
- License: mit
- Created: 2020-11-24T16:40:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-03T15:41:30.000Z (almost 4 years ago)
- Last Synced: 2025-06-26T16:07:31.090Z (11 months ago)
- Topics: bbox, buffer, geojson, shape
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/shapes-bufferer
- Size: 65.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shapes-bufferer
Apply a distance buffer to a GeoJSON, BBox, or geohash
## Installation
Using npm `npm i shapes-bufferer`
Using yarn `yarn add shapes-bufferer`
## Usage
In CommonJS env
```javascript
const { bufferFeature } = require('shapes-bufferer');
const geojson = {
type: 'Feature',
geometry: {
type: 'Polygon',
coordinates: [
[
[-3.687352, 40.440563],
[-3.674112, 40.445444],
[-3.66824, 40.434788],
[-3.686987, 40.429722],
[-3.687352, 40.440563],
],
],
},
};
// Apply a 1km buffer around the GeoJSON
const buffered = bufferFeature(geojson, 1);
```
Using imports
```javascript
import { bufferBBox } from 'shapes-bufferer';
bufferBBox([-3.707651, 40.423234, -3.679004, 40.437593], 1);
```
## Documentation
See [DOCS](./docs/modules.md)