Description
VECCopyWholePolygonLayer() is used to copy the indicated source area layer (LAYER_TYPE = AREA), to a new layer (or existing) layer on the destination file.
Call Signature
int VECCopyWholePolygonLayer ( int/string filespec_src, int layer_src, int/string filespec_dst [, int layer_dst] )
Return Value
int
Segment number of the existing segment or of the new segement created.
Arguments
int/string filespec_src:
This can either be the handle returned by DBOpen() or the name of an open file.
int layer_src:
The vector layer (segment) number being read.
int/string filespec_dst:
This can either be the handle returned by DBOpen() or the name of an open file.
[ int layer_dst ]:
The vector layer to be overwritten. If omitted a new layer (segment) will be created.
Remarks
The area layer will be converted to a whole polygon (LAYER_TYPE = WHOLE_POLYGON) layer on the destination file and all the arcs for the area will be attached as vertices. That is the result of the function is the generation of a new polygon layer or the overwriting of an existing segment.
Example
Convert segments 31 (areas), and 28 (arcs) on irvine.pix into a whole polygon layer.
local int tfid
local int layer, int segnum
layer = 31
del "my.pix" noerror
try
call CopyFile(GetPCIHOME()+"/demo/irvine.pix", "my.pix")
tfid = DBOpen("my.pix", "r+")
segnum = VECCopyWholePolygonLayer( tfid, layer, tfid )
call DBClose( tfid)
if ( layer = segnum) then
print " Segment overwritten: ", layer
else
print " New segment created: ",segnum
endif
OnError
print "Error: ", GetLastErrorMessage()
EndOnError
Output:
Creating segment: 29 [ 116: @VectorsPolygons:Vectors/Polygons] 2 Blocks long New segment created: 29
See also
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.