GRASS ASCII vector format specification
A vector map in GRASS native vector format may contain a mix of primitives including points, lines, boundaries, centroids, areas, faces, and kernels. The GRASS ASCII vector format may contain also a header with various metadata (see example below).
The header is similar as the head file of vector binary format but contains bounding box also. Key words are:
ORGANIZATIONDIGIT DATEDIGIT NAMEMAP NAMEMAP DATEMAP SCALEOTHER INFOZONEWEST EDGEEAST EDGESOUTH EDGENORTH EDGEMAP THRESH
The body begins with the row:
VERTI:
followed by records of primitives:
TYPE NUMBER_OF_COORDINATES [NUMBER_OF_CATEGORIES]X Y [Z]....X Y [Z][ LAYER CATEGORY]....[ LAYER CATEGORY]
Everything above in [ ] 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 coordinates 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
X Y [Z]
In pre-GRASS 6 versions of the ASCII format, the order of coordinates was different:
Y X
Latitude/Longitude data may be given in a number of ways. Decimal degrees must be positive or negative instead of using a hemisphere letter. Mixed coordinates must use a hemisphere letter. Whole minutes and seconds must always contain two digits (example: use 167:03:04.567; and not 167:3:4.567).
Acceptable formats:
key: D=Degrees; M=Minutes; S=Seconds; h=Hemisphere (N,S,E,W)
- •
-
(+/-)DDD.DDDDD
- •
-
DDDh
- •
-
DDD:MMh
- •
-
DDD:MM.MMMMMh
- •
-
DDD:MM:SSh
- •
-
DDD:MM:SS.SSSSSh
EXAMPLES
ORGANIZATION: GRASS Development TeamDIGIT DATE: 1/9/2005DIGIT NAME: -MAP NAME: testMAP DATE: 2005MAP SCALE: 10000OTHER INFO: Test polygonsZONE: 0MAP THRESH: 0.500000VERTI:B 65958812.48844435 3400828.842210115958957.29887089 3400877.112352295959021.65906046 3400930.74584365959048.47580612 3400973.652636655959069.92920264 3401032.649477095958812.48844435 3400828.84221011C 1 15958952.42189184 3400918.231264191 20B 45959010.9323622 3401338.360377575959096.7459483 3401370.540472355959091.38259917 3401450.990709325959010.9323622 3401338.36037757C 1 15959063.08352122 3401386.985332771 21
In this case the vector map contains 2 boundaries (first boundary with 6 vertices, second with 4 vertices) without category and 2 centroids with category number 20 and 21 (layer 1).
SEE ALSO
v.in.ascii, v.out.ascii, v.edit, v.support
SOURCE CODE
Available at: GRASS ASCII vector format specification source code (history)
Accessed: Monday Feb 24 10:57:24 2025
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual