6.5.0 • Published 20 hours ago

@turf/buffer v6.5.0

Weekly downloads
134,673
License
MIT
Repository
github
Last release
20 hours 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-941ellipse-gis-vueosm-edit-bundleoverpass-frontendnebula.glopenlayermaplxleaflet-overpass-lensluke.glmap_cloud_awaremapbox-measuresmapbox-gl-js-mockmini-tokyo-3dqwc2shapes-bufferersharedstreetsshinegis-clientsailing_cesiumroundware-web-frameworkrescape-osmreact-give-me-maptongmap-jsyymap-turfx-hongtu-utilvue-openlayervue-openlayer-basevue-openlayer-baseluovue-openlayer-darkvue-openlayer-huhongxunvue-openlayer-luoxuvue-openlayer-lxvue-openlayer-sailingmapvue-openlayer-slmapvue-openlayer-slmap1vue-openlayers-dvue-openlayer-mapvue-openlayer-maplxvue-openlayer-mapslvue3-openlayersvue3-openlayer-slmapagentmaps@bencevans/xyz-intersect@seasketch/geoprocessing@beyondtracks/nsw-rfs-geojson-feeds@beyondtracks/nsw-rfs-majorincidents-geojson@parkingboss/svelte-utils@twinlify/nexus@nebula.gl/layers@nebula.gl/edit-modes@turf/turf@bmap-turf/turf@ragone/edit-modes@emuanalytics/flow-rdf-core@emuanalytics/flow-rdf-core-test@zalastax/nolb-_tur@sword916/vae-map@varlab-ucf/nebula.gl@varlab-ucf/nebulagl-edit-modes@varlab-ucf/nebulagl-layers@deck.gl-community/editable-layers@corpsmap/corpsmap@citydna/experiencegtfs-to-geojsonhafas-find-stationscap-au-to-geojsonelectronic-fence-jscykj@hive9/mapbox-gl-mockellipse-gis-vue2@hongtu-next/core@hongtu-next/utilhg-gitlabtest-personpkgduev-endangered-areas-nrw@dhis2/gis-api@dhis2/maps-gl@klltech/boundariesheli-agri@juicyllama/utilshongtu-utilic-map-ui@kyfe/kyemap-jsdatasarana-jsgas3d.gl@loudsrl/turf@makina-corpus/mapbox-gl-forbidden-areagisviewer-vue-cdgisviewer-vue2-cesiumgisviewer-vue3-arcgisgeospatialdraw@mapbox/carmen@mapbox/carmen-private@mapbox/osm-compare@longruan/vae-map@maptalks/analysis@mingxiali/vae-mapjoymap-js
7.0.0-alpha.115

20 hours ago

7.0.0-alpha.114

1 month ago

7.0.0-alpha.113

3 months ago

7.0.0-alpha.111

3 months ago

7.0.0-alpha.110

4 months ago

7.0.0-alpha.1

7 months ago

7.0.0-alpha.2

7 months ago

7.0.0-alpha.0

1 year ago

6.5.0

3 years ago

6.4.0

3 years ago

6.3.0

3 years ago

6.2.0

3 years ago

6.2.0-alpha.3

3 years ago

6.2.0-alpha.2

4 years ago

6.2.0-alpha.1

4 years ago

5.1.5

6 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.5

6 years ago

5.0.4

6 years ago

5.0.0

6 years ago

4.7.4

7 years ago

4.7.3

7 years ago

4.7.1

7 years ago

4.7.0

7 years ago

4.6.1

7 years ago

4.6.0

7 years ago

4.5.2

7 years ago

4.5.1

7 years ago

4.5.0

7 years ago

4.4.0

7 years ago

4.3.1

7 years ago

4.3.0

7 years ago

4.2.0

7 years ago

4.1.0

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.14.0

7 years ago

3.13.0

7 years ago

3.11.7

7 years ago

3.10.5

7 years ago

3.10.4

7 years ago

3.10.3

7 years ago

3.10.2

7 years ago

3.10.0

7 years ago

3.7.5

7 years ago

3.7.3

7 years ago

3.7.2

7 years ago

3.7.1

7 years ago

3.7.0

7 years ago

3.6.3

7 years ago

3.6.2

7 years ago

3.6.1

7 years ago

3.5.3

7 years ago

3.5.2

8 years ago

3.3.3

8 years ago

3.2.0

8 years ago

3.1.2

8 years ago

3.1.1

8 years ago

3.0.18

8 years ago

3.0.16

8 years ago

3.0.15

8 years ago