Table of Contents

Class SpatialBuffer

Namespace
YndigoBlue.Velocity.Functions
Assembly
YndigoBlue.Velocity.dll

Represents the ST_Buffer spatial analysis function that creates a buffer zone around a geometry or geography.

public class SpatialBuffer : Function, ICheckItem, IDefaultItem, IFilterItem, IElement
Inheritance
SpatialBuffer
Implements

Remarks

Warning

Spatial functions are not available in the Community Edition of Velocity. They require the Full Edition.

The ST_Buffer function returns a geometry or geography that represents all points within a specified distance from the input spatial object. For Geometry types (planar), the buffer distance is in coordinate system units. For Geography types (spherical), the distance can be specified with a unit of measure. Buffers are useful for proximity analysis, creating zones of influence, or spatial joins with tolerance. The resulting geometry is typically a polygon (or multi-polygon) with rounded corners. OGC-compliant.

SpatialBuffer diagram showing buffer zones

Buffer Results by Input Type:

Input TypeBuffer Result
POINTCircular POLYGON centered on the point
LINESTRINGPOLYGON with rounded ends (stadium shape)
POLYGONExpanded POLYGON with rounded corners
MULTIPOINTMULTIPOLYGON (circles may merge if close)

Example Results (using test geometries, distance=0.5°):

ShapeBuffer Result
PT1 (point)Circular POLYGON (radius 0.5°)
PT2 (point)Circular POLYGON (radius 0.5°)
LN1 (linestring)POLYGON (rounded rectangle)
PY1 (rectangle)Expanded POLYGON with rounded corners
PY3 (triangle)Expanded POLYGON with rounded corners

Units of Measure: For Geography types, use UnitOfMeasure to specify the buffer distance in meters, kilometers, miles, or other supported units. The distance parameter is interpreted in the specified unit — pass different values to achieve the same physical buffer size.

SpatialBuffer Geography diagram showing buffer zone with UnitOfMeasure distance input

UnitOfMeasuredistance= value for a 200 km buffer (GA at -101°,40°)
Meter200,000
Kilometer200
Mile124.3
Foot656,168
Yard218,723
Inch7,874,016

Examples

Create a 500-unit buffer zone around each store location:

var schema = manager.LoadSchema("retail");
var stores = schema["stores"];

var query = new Query()
    .Select([ stores["id"], new Expression("coverage_area", new SpatialBuffer(stores["location"], new Literal<double>(500.0))) ])
    .From(stores);

var results = manager.Retrieve(query);

Constructors

SpatialBuffer(Geometry, float)

Initializes a new instance of ST_Buffer with a geometry literal and distance.

SpatialBuffer(Geometry, Expression)

Initializes a new instance of ST_Buffer with a geometry literal and distance expression.

SpatialBuffer(Column, float)

Initializes a new instance of ST_Buffer with a geometry column and distance.

SpatialBuffer(Column, float, UnitOfMeasure)

Initializes a new instance of ST_Buffer with a geography column, distance, and unit of measure.

SpatialBuffer(Column, Expression)

Initializes a new instance of ST_Buffer with a geometry column and distance expression.

SpatialBuffer(Column, Expression, UnitOfMeasure)

Initializes a new instance of ST_Buffer with a geography column, distance expression, and unit of measure.

SpatialBuffer(Function, float)

Initializes a new instance of ST_Buffer with a function result (geometry) and distance.

SpatialBuffer(Function, float, UnitOfMeasure)

Initializes a new instance of ST_Buffer with a function result (geography), distance, and unit of measure.

SpatialBuffer(Function, Expression)

Initializes a new instance of ST_Buffer with a function result (geometry) and distance expression.

SpatialBuffer(Function, Expression, UnitOfMeasure)

Initializes a new instance of ST_Buffer with a function result (geography), distance expression, and unit of measure.

SpatialBuffer(Geography, float, UnitOfMeasure)

Initializes a new instance of ST_Buffer with a geography literal, distance, and unit of measure.

SpatialBuffer(Geography, Expression, UnitOfMeasure)

Initializes a new instance of ST_Buffer with a geography literal, distance expression, and unit of measure.