VECBUF

Create buffer zone around vector set


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Related

Back to top

Description


Creates a graphic mask defining a buffer zone that surrounds vector data, given a user-specified buffer width.
Note: VECBUF does not support topological polygon layers as input. You can convert topological polygons into whole polygons using TPOLY2POLY.
Back to top

Parameters


vecbuf(file, dbvs, dbob, dbow, bufdist)

Name Type Caption Length Value range
FILE * str Input file name 1 -    
DBVS * List[int] Input vector segment(s) 1 -    
DBOB List[int] Output bitmap 0 - 1  
DBOW List[int] Output raster window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
BUFDIST * List[float] Buffer width (geo units) 1 - 1 0 -

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the PCIDSK file that contains the input data and which will receive the output results.

DBVS

Specifies the input vector segment(s) for which a buffer zone is to be constructed.

DBOB

Specifies the bitmap segment to receive the output vector buffer results.

A value of 1 (one) will be written to all bitmap pixels that are within the buffer area of a vector feature; all other pixels will be unchanged. If no output bitmap is specified, a new segment will be created and initialized to zero.

DBOW

Specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) to be output. If this parameter is not specified, the entire image is output by default.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

BUFDIST

Specifies the width of the buffer around vectors, in the distance units of the georeferencing segment of the input file.

If the input file is not georeferenced, the function uses PIXELS; otherwise it uses meters, feet, or decimal degrees, depending on the georeferencing system of the file.

Back to top

Details

VECBUF generates masks for buffer regions around features stored as vector data, given the user-specified buffer width. The function acts to burn a value of 1 into the output bitmap segment for all pixels considered to be within the buffer area of one or more vectors.

The buffer areas are centered around the vector features using pixel-level precision. All vectors are treated as points, or polylines; closed polylines are not treated as filled polygons.

The result of running VECBUF is a bitmap segment marking pixels within the buffer areas of the vector segment lines. This result may be burned into an image channel using the THR (thresholding image to bitmap) function. The GRDVEC (vector encoding) function can be used to simply burn vector data into an image channel.

The algorithm used is quite simplistic, and will produce squared, rather than rounded masks at the ends of lines. Strictly speaking, this means that the proximity test is inaccurate at the end points. This effect is particularly pronounced for point features, for which the resulting buffer is always a square, not a circle.

Back to top

Example

Build a 150m wide mask of the hydrography vectors in segment 26.

from pci.vecbuf import vecbuf

file	=	'irvine.pix'
dbvs	=	[26]	# vector segment
dbob	=	[]	# create new bitmap segment
dbow	=	[]	# process entire image
bufdist	=	[150]	# buffer width

vecbuf( file, dbvs, dbob, dbow, bufdist )

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.