geo-registry

Buffer

Polygons covering everything within a given distance of the input features.

Pitfall. A planar buffer of data in a geographic CRS is in degrees unless the engine switches to geodesic.
About this operation
Also called buffer zone, proximity zone, offset polygon, Pairwise Buffer
Group vector/proximity
Checks crs.measure, geometry.valid
Pitfalls 1 listed above
Columbus tool vector_op · buffer
Notes Not stated
Status active
Broader Not stated
Narrower Not stated
Related Not stated

Parameters

Name Type Required Default Values Note
distance length yes Not stated Not stated Not stated
unit enum yes Not stated m, ft, us-ft, km, mi Not stated
dissolve boolean no no Not stated Merge all buffers into one shape.
segments integer no 8 Not stated Segments per quarter circle; more is smoother.

Inputs and outputs

Direction Name Type Geometry Note
Input layer vector Not stated Not stated
Output output vector polygon Not stated

In each engine

Engine Tool Parameters Differences
apache-sedona sedona.sql.ST_Buffer
  • distance → buffer
  • unit always crs-units. CRS units; with useSpheroid = true on longitude/latitude data, metres.
  • dissolve always no. Aggregate with ST_Union_Aggr.
  • segments quad_segs=N in the parameters text.
  • layer → geometry
  • A Spark SQL function: arguments are columns or column names, run over a Spark DataFrame.
gdal gdal vector buffer
  • distance → distance
  • unit always crs-units. Distance is in the layer's CRS units; convert it first.
  • dissolve always no. No dissolve; union the output afterwards.
  • segments → quadrant-segments
  • layer → input
  • output → output
  • Distance is in the layer's CRS units, so data in a geographic CRS is buffered in degrees.
geopandas geopandas.GeoSeries.buffer
  • distance → distance
  • unit always crs-units. Distance is in the series' CRS units; convert it first.
  • dissolve always no. Call union_all or dissolve on the result.
  • segments → quad_segs
  • Called on the GeoSeries itself; returns a GeoSeries without the other columns.
  • Warns but still buffers in degrees when the CRS is geographic.
grass v.buffer
  • distance → distance
  • unit always crs-units. Distance is in the map units of the GRASS project.
  • layer → input
  • output → output
None noted
postgis st_buffer
  • distance → radius
  • unit always crs-units. On geometry, CRS units; on geography, metres.
  • dissolve always no. Aggregate with ST_Union.
  • segments → quadsegs
  • layer → geom
  • On a geometry column the distance is in CRS units (degrees for EPSG:4326); cast to geography for metres.
  • Caps and joins go in the options text ('endcap=flat join=mitre').
qgis native:buffer
  • distance → DISTANCE
  • unit always crs-units. Distance is in the layer's CRS units; convert it first.
  • dissolve → DISSOLVE
  • segments → SEGMENTS
  • layer → INPUT
  • output → OUTPUT
  • Distance is in the layer's CRS units, so data in a geographic CRS is buffered in degrees.
  • Defaults to 5 segments per quarter circle (Columbus uses 8).
sf sf::st_buffer
  • distance → dist
  • unit always crs-units. Projected data: CRS units. Longitude/latitude data with sf_use_s2() on (the default): metres, through S2.
  • dissolve always no. Call st_union on the result.
  • segments → nQuadSegs
  • layer → x
  • Default nQuadSegs is 30 segments per quarter circle (Columbus 8).
  • On longitude/latitude data with S2 the buffer is built from S2 cells, so its outline differs from a GEOS buffer; nQuadSegs, end caps and joins only apply with GEOS.
shapely shapely.buffer
  • distance → distance
  • unit always crs-units. Shapely has no CRS; distance is in the coordinates' units.
  • dissolve always no. Union the results with shapely.union_all.
  • segments → quad_segs
  • layer → geometry
  • Works on geometries, not layers, and knows no CRS.
terra terra::buffer
  • distance → width
  • unit always crs-units. Projected data: CRS units. Longitude/latitude data: metres.
  • dissolve always no. Call aggregate on the result.
  • segments → quadsegs
  • layer → x
  • Default quadsegs is 10 (Columbus 8); quadsegs, cap and join styles are ignored for longitude/latitude data.
  • On a SpatRaster, buffer marks the cells within the distance of non-NA cells instead.
turf-js turf.buffer
  • distance → radius
  • unit → options.units : m = meters; ft = feet; km = kilometers; mi = miles. not supported: us-ft
  • dissolve always no. Call turf.dissolve or turf.union on the result.
  • segments → options.steps
  • layer → geojson
  • units defaults to kilometers.
  • Each feature is buffered in an azimuthal equidistant projection centred on it, so distances are true ground distances near the feature.
  • Turf works on GeoJSON in longitude/latitude (WGS 84); data in another CRS must be reprojected first.