THSNPOLY

Thiessen polygons (Voronoi diagram) from points


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

Back to top

Description


Creates a Thiessen polygon channel (Voronoi diagram) from an input point layer.
Back to top

Parameters


thsnpoly(fili, filo, dbvs, usegeo, srcattr)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
FILO str Output file name 0 -    
DBVS * List[int] Input vector segment 1 - 1  
USEGEO str Use Georeferencing 0 - 3 ON | OFF
Default: OFF
SRCATTR str Source attributes 0 - 4 COPY | JOIN
Default: COPY

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the input PCIDSK file that contains the point layer from which the Thiessen polygons will be constructed.

FILO

Specifies the name of the PCIDSK image file to receive the Thiessen polygons from the point segment. If the specified output file does not exist, THNSPOLY creates it.

DBVS

Specifies the vector segment that contains the point layer for which the Thiessen polygons will be constructed.

USEGEO

Specifies whether the use Georeferencing from the input file to calculate the projection and geographic extents of the resulting polygon layer.

Available options are:

SRCATTR

Specifies whether the attributes from the source layer are copied or joined to the point layer.

Supported options are:
Back to top

Details

THSNPOLY takes an input point layer and generates a Thiessen polygon layer. A Thiessen polygon, or Voronoi diagram, defines a polygon about a point such that all locations within the polygon are closer to that point than to any other point. In the THSNPOLY function, one polygon is generated for each input point.

The attributes for the polygon layer, which include area, perimeter, and the attributes from the original layer, are either copied to the new layer or joined (linked) to the original layer. If joined, an attribute named "SourceID" will be added as the join field.

The extents of the generated layer are determined from either the input point layer (+ 10%) or from an optional georeferencing input.

Raster Thiessen polygons can be generated using the GRDPIN function, although you must enter a parameter value of 1 for "Number of sample Points".

This function can be used to model zones of influence.

Back to top

Example

The following example create a Thiessen polygon layer in the file "output.pix", based on point layer 32 in the file "irvine.pix".

from pci.thsnpoly import thsnpoly

fili	=	'irvine.pix'	# input file name
filo	=	'output.pix'	# will be created
dbvs	=	[32]	# vector segment containing point layer
usegeo	=	''	# default, "OFF"
srcattr	=	''	# default, "COPY"

thsnpoly( fili, filo, dbvs,usegeo, srcattr )

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