# GRASS 5.7/6 Vector Format and API

The API is described in

GRASS 6 Programmer's Manual

source code file:
lib/vector/vectorlib.dox

## Vector ASCII Format Specification

format notes here are outdated and to be merged into
vector/v.in.ascii/description.html

The ASCII format in the new version contains support for categories, z-coordinates, and the new types centroid, face, and kernel. Points and centroids are saved as one coordinate pair instead of two. File is saved in old dig_ascii directory but the name will be probably changed.

### Head

The head of the file is similar as the head file of vector binary format but contains bounding box also. Key words are:

    ORGANIZATION
    DIGIT DATE
    DIGIT NAME
    MAP NAME
    MAP DATE
    MAP SCALE
    OTHER INFO
    ZONE
    WEST EDGE
    EAST EDGE
    SOUTH EDGE
    NORTH EDGE
    MAP THRESH

### Body

The body begins with the row:

    VERTI:

followed by records of lines:

    TYPE NUMBER_OF_COORDINATES [NUMBER_OF_CATEGORIES]
     X Y [Z]
    ....
     X Y [Z]
    [ FIELD CATEGORY]
    ....
    [ FIELD CATEGORY]

Everything above in [ ] is optional. Note the coordinate order in the old version (Y X) has been changed to (X Y [Z]).
TYPE may be:

- P point (dot)
- p dead point (dead dot)
- L line
- l dead line
- B(A) boundary
- b(a) dead boundary
- C centroid
- c dead centroid
- F face (3D boundary)
- K kernel (3D centroid)

Example of records:

    P 1 1
     1234 3435
     1 354
    L 3 1
     4132 4534
     1453 1454
     1453 4543
     1 355

## Vector module programming example

Vector module C programming example

## Vector module upgrade status

Vector upgrade status (partially outdated)

$Date$