shapes-bufferer
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

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

import { bufferBBox } from 'shapes-bufferer';

bufferBBox([-3.707651, 40.423234, -3.679004, 40.437593], 1);

Documentation

See DOCS

Package Sidebar

Install

npm i shapes-bufferer

Weekly Downloads

134

Version

1.0.0

License

MIT

Unpacked Size

11.1 kB

Total Files

7

Last publish

Collaborators

  • alrico88