7.2.0 • Published 4 months ago

@turf/buffer v7.2.0

Weekly downloads
134,673
License
MIT
Repository
github
Last release
4 months ago

@turf/buffer

buffer

Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees.

When using a negative radius, the resulting geometry may be invalid if it's too small compared to the radius magnitude. If the input is a FeatureCollection, only valid members will be returned in the output FeatureCollection - i.e., the output collection may have fewer members than the input, or even be empty.

Parameters

  • geojson (FeatureCollection | Geometry | Feature<any>) input to be buffered
  • radius number distance to draw the buffer (negative values are allowed)
  • options Object Optional parameters (optional, default {})
    • options.units string any of the options supported by turf units (optional, default "kilometers")
    • options.steps number number of steps (optional, default 64)

Examples

var point = turf.point([-90.548630, 14.616599]);
var buffered = turf.buffer(point, 500, {units: 'miles'});

//addToMap
var addToMap = [point, buffered]

Returns (FeatureCollection | Feature<(Polygon | MultiPolygon)> | undefined) buffered features


This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.

Installation

Install this module individually:

$ npm install @turf/buffer

Or install the Turf module that includes it as a function:

$ npm install @turf/turf
airsiders-mapping-tool@bimenergy/calculation-utilstest-map-component@elijahjpassmore/qwc2@infinitebrahmanuniverse/nolb-_turcitymap@everything-registry/sub-chunk-941x-hongtu-util@corpsmap/corpsmap@bencevans/xyz-intersect@rsmap/vue3oljmapcloud-ng-terrainjoymap-jsqwc2ugis-coretongmap-jsvue-openlayer-sailingmapvue-openlayer-slmapvue-openlayer-slmap1vue-openlayers-dvue-openlayer-darkvue-openlayer-huhongxunvue-openlayer-luoxuvue-openlayer-lxvue-openlayer-mapvue-openlayer-maplxvue-openlayer-mapslvue-openlayervue-openlayer-basevue-openlayer-baseluo@bmap-turf/turf@beyondtracks/nsw-rfs-geojson-feeds@beyondtracks/nsw-rfs-majorincidents-geojson@citydna/experience@deck.gl-community/editable-layers@dhis2/gis-api@dhis2/maps-glyymap-turfvue3-openlayer-slmapvue3-openlayers@ragone/edit-modes@hive9/mapbox-gl-mock@hongtu-next/core@hongtu-next/util@kyfe/kyemap-js@longruan/vae-map@loudsrl/turf@mapbox/carmen@mapbox/carmen-private@maptalks/analysis@mapbox/osm-compare@nebula.gl/edit-modes@nebula.gl/layers@emuanalytics/flow-rdf-core@emuanalytics/flow-rdf-core-test@mingxiali/vae-map@makina-corpus/mapbox-gl-forbidden-area@klltech/boundaries@juicyllama/utils@phila/pinboard@parkingboss/svelte-utilsmini-tokyo-3dopenlayermaplxoverpass-frontendosm-edit-bundleroundware-web-frameworksailing_cesiumreact-give-me-mapnebula.glrescape-osmshapes-bufferershinegis-clientsharedstreetsgisviewer-vue-cdgisviewer-vue2-cesiumgisviewer-vue3-arcgisic-map-uigtfs-to-geojsonhongtu-utilhg-gitlabtest-personpkgheli-agrihafas-find-stationsluke.glmapbox-draw-circle-modemapbox-measuresmapbox-gl-js-mockmap_cloud_awareleaflet-overpass-lens@sword916/vae-map@varlab-ucf/nebula.gl@varlab-ucf/nebulagl-edit-modes@varlab-ucf/nebulagl-layers@twinlify/nexus@turf/turf@wn-test/core@zalastax/nolb-_turagentmapscap-au-to-geojsondatasarana-jsellipse-gis-vue
7.2.0

4 months ago

7.1.0

9 months ago

7.1.0-alpha.70

9 months ago

7.0.0

11 months ago

7.1.0-alpha.7

10 months ago

7.0.0-alpha.116

12 months ago

7.0.0-alpha.115

1 year ago

7.0.0-alpha.114

1 year ago

7.0.0-alpha.113

1 year ago

7.0.0-alpha.111

1 year ago

7.0.0-alpha.110

1 year ago

7.0.0-alpha.1

2 years ago

7.0.0-alpha.2

2 years ago

7.0.0-alpha.0

2 years ago

6.5.0

4 years ago

6.4.0

4 years ago

6.3.0

4 years ago

6.2.0

4 years ago

6.2.0-alpha.3

4 years ago

6.2.0-alpha.2

5 years ago

6.2.0-alpha.1

5 years ago

5.1.5

7 years ago

5.1.1

7 years ago

5.1.0

7 years ago

5.0.5

7 years ago

5.0.4

7 years ago

5.0.0

7 years ago

4.7.4

8 years ago

4.7.3

8 years ago

4.7.1

8 years ago

4.7.0

8 years ago

4.6.1

8 years ago

4.6.0

8 years ago

4.5.2

8 years ago

4.5.1

8 years ago

4.5.0

8 years ago

4.4.0

8 years ago

4.3.1

8 years ago

4.3.0

8 years ago

4.2.0

8 years ago

4.1.0

8 years ago

4.0.2

8 years ago

4.0.1

8 years ago

4.0.0

8 years ago

3.14.0

8 years ago

3.13.0

8 years ago

3.11.7

8 years ago

3.10.5

8 years ago

3.10.4

8 years ago

3.10.3

8 years ago

3.10.2

8 years ago

3.10.0

8 years ago

3.7.5

8 years ago

3.7.3

8 years ago

3.7.2

8 years ago

3.7.1

8 years ago

3.7.0

8 years ago

3.6.3

8 years ago

3.6.2

8 years ago

3.6.1

8 years ago

3.5.3

8 years ago

3.5.2

9 years ago

3.3.3

9 years ago

3.2.0

9 years ago

3.1.2

9 years ago

3.1.1

9 years ago

3.0.18

9 years ago

3.0.16

9 years ago

3.0.15

9 years ago