VWRITE

Write vector data to text file


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

Back to top

Description


Writes vector (line and point) data from an existing PCIDSK database vector layer to a new text file.
Note: Use FEXPORT to write text files used by third-party GIS software.
Back to top

Parameters


vwrite(file, dbvs, filv, dmsform, fldnme)

Name Type Caption Length Value range
FILE * str Input file name 1 -    
DBVS * List[int] 1 - 1  
FILV * str Output vector file name 1 -    
DMSFORM str Deg/Min/Sec Format: ON/OFF 0 - 3 ON | OFF
Default: OFF
FLDNME str Field name for attribute value to be written 0 - 64 Default: Attribute

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the PCIDSK file that contains the vector segment (type VEC:116) to be written to the text file.

DBVS

Specifies the input vector segment (type VEC:116) to be written to the text file.

FILV

Specifies the name of the text file to be created to receive the written vector information.

This is NOT a PCIDSK file. The specified output file must not exist before running VWRITE.

DMSFORM

Specifies whether LONG/LAT coordinates should be output using real numbers or degrees/minutes/seconds/hemisphere strings.

Available options are:

This parameter is ignored if vector units are not LONG/LAT.

FLDNME

Specifies the field name that contains an attribute value to be written for each shape.

If this parameter is specified as ZCOORD, the actual z-coordinates of the vectors are used. Field names are not case-sensitive, and they do not need to be specified in complete form. If more than one match exists, the first name is used.

Supported values are:
Back to top

Details

VWRITE writes vector (line and/or point) information from a vector segment (type VEC:116) to a text file. The use of an intermediate file to hold vector information allows vector data from a PCIDSK file to be edited.

When running VWRITE, the vector information held in the vector segment (DBVS) of the PCIDSK file (FILE) is written to the specified text file (FILV) in the output format specified below.

 Structure Type     Attribute Value 
 X-Coordinate      Y-Coordinate
 X-Coordinate      Y-Coordinate
 ...
where:

Fields are separated by a comma or space.

If vector units are LONG/LAT, DMSFORM specifies the format for the longitude and latitude coordinates.

Each vector may contain more than one attribute field. The FLDNME parameter is used to specify which attribute field to use.

Back to top

Examples

Write the vectors stored in segment 25 (DLGTRANS) on irvine.pix to a text file. DMSFORM is ignored because vectors are stored using UTM units.

from pci.vwrite import vwrite

file	=	r"/demo/irvine.pix"
dbvs	=	[25]
filv	=	"dlgtrans.txt"
dmsform	=	""	# default, "OFF"
fldnme	=	""	# default, "Attribute"

vwrite( file, dbvs, filv, dmsform, fldnme )

The beginning of the text file dlgtrans.txt looks like this:

     LINE        1700210
 440855.00    3732105.00
 440849.34    3732100.09
 440742.86    3732131.28
 440471.17    3732145.78
 440283.44    3732180.05
 440143.81    3732191.14
 440052.54    3732217.15
 440024.75    3732240.19
 439992.00    3732281.05
     LINE        1700210
 439815.21    3732051.08
 439827.98    3732061.15
 439911.93    3732080.92
 439975.36    3732070.34
 440021.10    3732072.57
     LINE        1700205
 439815.21    3732051.08
 439805.13    3732063.85
 439783.19    3732201.16
 439773.04    3732203.76

Suppose that the PCIDSK file geometry.pix has the following vector data in segment 3 and that its units are PIXEL. The lines have an attribute value of zero and the point (2,2) has an attribute value of 999.

              (1,1)   (8,1)    (18,1)
                +-------+         +
                | x(2,2)|        /
                |       |       /
                +-------+      +
              (1,4)  (8,4)  (15,4)

Write this information to a text file as follows:

from pci.vwrite import vwrite

file	=	"geometry.pix"
dbvs	=	[3]
filv	=	"vectors.dat"
dmsform	=	""	# default, "OFF"
fldnme	=	""	# default, "Attribute"

vwrite( file, dbvs, filv, dmsform, fldnme )

The output text file vectors.dat contains the following:

    LINE              0
    1.000         1.000
    8.000         1.000
    8.000         4.000
    1.000         4.000
    POINT           999
    2.000         2.000
    LINE              0
   18.000         1.000
   15.000         4.000

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