File: vectorlib_ascii.dox

package info (click to toggle)
grass 8.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 277,040 kB
  • sloc: ansic: 460,798; python: 227,732; cpp: 42,026; sh: 11,262; makefile: 7,007; xml: 3,637; sql: 968; lex: 520; javascript: 484; yacc: 450; asm: 387; perl: 157; sed: 25; objc: 6; ruby: 4
file content (120 lines) | stat: -rw-r--r-- 2,694 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*! \page vlibAscii Vector ASCII Format

by GRASS Development Team (https://grass.osgeo.org)

\tableofcontents

\section vlibAsciiMain Vector ASCII Format Specifications

The GRASS ASCII vector map format may contain a mix of primitives
including points, lines, boundaries, centroids, faces, and
kernels. The format may also contain a header with various metadata
(see example below).

Vector map can be converted to the ASCII representation at user level
by <tt>v.out.ascii format=standard</tt> command.

See \ref vlibAsciiFn for list of related functions.

The header is similar as the head file of vector binary format (see
\ref vlibHeadFileFormat) but contains bounding box also. Keywords are:

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

Example:

\verbatim
ORGANIZATION: NC OneMap
DIGIT DATE:
DIGIT NAME:   helena
MAP NAME:     North Carolina selected bridges (points map)
MAP DATE:     Mon Nov  6 15:32:39 2006
MAP SCALE:    1
OTHER INFO:
ZONE:         0
MAP THRESH:   0.000000
\endverbatim

The body begins with the row:

\verbatim
VERTI:
\endverbatim

followed by records of primitives:

\verbatim
TYPE NUMBER_OF_COORDINATES [NUMBER_OF_CATEGORIES]
 X Y [Z]
....
 X Y [Z]
[ LAYER CATEGORY]
....
[ LAYER CATEGORY]
\endverbatim

Everything above in <tt>[]</tt> is optional.

The primitive codes are as follows:

- 'P': point
- 'L': line
- 'B': boundary
- 'C': centroid
- 'F': face (3D boundary)
- 'K': kernel (3D centroid)
- 'A': area (boundary) - better use 'B'; kept only for backward
compatibility

The coordinates are listed following the initial line containing the
primitive code, the total number of vectors in the series, and (optionally)
the number of categories (1 for a single layer, higher for multiple layers).
Below that 1 or several lines follow to indicate the layer number and
the category number (ID).

The order of coordinates is
\verbatim
  X Y [Z]
\endverbatim

Note: The points are stored as y, x (i.e., east, north), which is the
reserve of the way GRASS usually represents geographic coordinates.

Example:

\verbatim
P  1 1
 375171.4992779 317756.72097616
 1     1
B  5
 637740       219580
 639530       219580
 639530       221230
 637740       221230
 637740       219580
C  1 1
 638635       220405
 1     2
\endverbatim

In this example, the first vector feature is a point with category
number 1. The second vector feature is a boundary composed by 5
points. The third feature is a centroid with category number 2. The
boundary and the centroid form an area with category number 2. All
vector feature mentioned above are located in layer 1.

*/