vectorascii(1)
π¦ GRASS ASCII VECTOR FORMAT SPECIFICATION π¦
okay bestie, sit down, hydrate, because this is vectorascii(1) from the GRASS GIS User's Manual and it is genuinely so much fun once it clicks π«Ά
π the whole vibe π
A vector map in GRASS native vector format may contain a mix of primitives β and before you panic, "primitives" just means the lil building blocks: points, lines, boundaries, centroids, areas, faces, and kernels, all coexisting in one file like a very well-behaved group chat. The GRASS ASCII vector format may contain also a header with various metadata (peep the example down below π).
π the header (aka the metadata moment) π
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 (where it gets real) β¨
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 β so if you don't see it, that's not a bug, that's just the format being chill π
π₯ the primitive codes π₯
'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
ngl, if you're reaching for'A', just use'B'instead.'A'is lowkey just here for the nostalgia π
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).
π§ coordinate order π§
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
not me living through the Y X era π if you're reading ancient data, check which order you're actually in before you trust a single vertex.
π latitude/longitude formats π
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.DDDDDDDDhDDD:MMhDDD:MM.MMMMMhDDD:MM:SShDDD:MM:SS.SSSSSh
πΈ EXAMPLES πΈ
ORGANIZATION: GRASS Development Team
DIGIT DATE: 1/9/2005
DIGIT NAME: -
MAP NAME: test
MAP DATE: 2005
MAP SCALE: 10000
OTHER INFO: Test polygons
ZONE: 0
MAP THRESH: 0.500000
VERTI:
B 6
5958812.48844435 3400828.84221011
5958957.29887089 3400877.11235229
5959021.65906046 3400930.7458436
5959048.47580612 3400973.65263665
5959069.92920264 3401032.64947709
5958812.48844435 3400828.84221011
C 1 1
5958952.42189184 3400918.23126419
1 20
B 4
5959010.9323622 3401338.36037757
5959096.7459483 3401370.54047235
5959091.38259917 3401450.99070932
5959010.9323622 3401338.36037757
C 1 1
5959063.08352122 3401386.98533277
1 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).
so basically: two outlines, two lil center dots, and the centroids are the ones holding the category IDs π
π SEE ALSO π
v.in.asciiv.out.asciiv.editv.support
π SOURCE CODE π
Available at: GRASS ASCII vector format specification source code (history)
Accessed: Friday Nov 21 14:02:57 2025
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, bestie β¨ Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual β this one's from GRASS 8.4.2 and it's the vectorascii(1) page, so go forth and read your ASCII vectors with main character energy π
ππ¦
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms