v.out.ascii1grass
Exports a vector map to a grass ascii vector representation. by default only features with category are exported. to export all features use ’layer=-1’.
Usage
v.out.ascii
v.out.ascii --help
v.out.ascii [-ocr]
input=name
[layer=string]
[type=string
[,string, ...]]
[output=name]
[columns=name
[,name, ...]]
[cats=range]
[where=sql_query]
format=string
[separator=character]
[precision=integer]
[--overwrite]
[--help]
[--verbose]
[--quiet]
[--ui]
Keywords
vector, export, output, ASCII
Overview
v.out.ascii converts a GRASS vector map in binary format to a GRASS vector map in ASCII format. Using flag -o v.out.ascii output will be in old (version 4) ASCII format.
If the output parameter is not given then the data is sent to standard output.
Notes
The v.in.ascii module performs the function of v.out.ascii in reverse; i.e. it converts vector maps in ASCII format to their binary format. These two companion modules are useful both for importing and exporting vector maps between GRASS and other software, and for transferring data between machines.
If old version is requested, the output files from v.out.ascii is placed in the $LOCATION/$MAPSET/dig_ascii/ and $LOCATION/$MAPSET/dig_att directory.
If layer > 0 then only features with a category number will be exported. Use v.category to add them if needed or define layer=-1 to export also features without category.
v.out.ascii in the old version mode (-o) does not copy the dig_cats file associated with the binary vector input map to the new output file name. The user must copy the dig_cats file to the new output name if this is desired (e.g. using the UNIX cp command).
It is possible to output the coordinates of vertices in a non-points vector feature by first converting the vector feature to a points map with v.to.points and then exporting with v.out.ascii in points mode.
Examples
Standard mode
See ASCII format specification.
v.out.ascii input=quads format=standardORGANIZATION: US Army Const. Eng. Rsch. LabDIGIT DATE: May 1987DIGIT NAME: grassMAP NAME: QuadsMAP DATE: May 1987MAP SCALE: 24000OTHER INFO:ZONE: 13MAP THRESH: 18.288000VERTI:B 4599587.1820962 4914067.53414294589639.15126831 4913922.5687301589440.96838162 4927803.62500018599375.87959179 4927959.83330436B 2599375.87959179 4927959.83330436599587.1820962 4914067.53414294B 4599587.1820962 4914067.53414294609541.5508239 4914236.0597482609316.10665227 4928116.8490555599375.87959179 4927959.83330436C 1 1594125.63 4921115.581 1C 1 1604433.84 4921087.11 2
Point mode
v.out.ascii input=quads format=point594125.63|4921115.58|1604433.84|4921087.1|2
Print also selected attributes:
v.out.ascii input=geodetic_pts format=point where="cat > 5 and cat <= 8" columns=GEOD_NAME573638.06289275|271623.25042595|6|27 WC 6574416.81289275|274116.65542595|7|27 WC 7575301.31189275|275303.81342595|8|27 WC 8
To print all attributes type columns=*:
v.out.ascii input=geodetic_pts format=point where="cat > 5 and cat <= 8" columns=*573638.06289275|271623.25042595|6|6|0.00000000|0.00000000|6|6|27 WC 6|573638.09200000|271623.24100000|0.00|0|1.00000000|1.00000000574416.81289275|274116.65542595|7|7|0.00000000|0.00000000|7|7|27 WC 7|574416.84100000|274116.64900000|0.00|0|1.00000000|1.00000000575301.31189275|275303.81342595|8|8|0.00000000|0.00000000|8|8|27 WC 8|575301.30600000|275303.82600000|0.00|0|1.00000000|1.00000000
WKT mode
WKT is abbreviation for Well-known text.
v.out.ascii input=quads format=wktPOLYGON((599587.18209620 4914067.53414294, 589639.15126831 4913922.56873010,589440.96838162 4927803.62500018, 599375.87959179 4927959.83330436,599587.18209620 4914067.53414294))POLYGON((599587.18209620 4914067.53414294, 599375.87959179 4927959.83330436,609316.10665227 4928116.84905550, 609541.55082390 4914236.05974820,599587.18209620 4914067.53414294))
Source code
Available at: v.out.ascii source code (history)
Accessed: Monday Feb 24 17:51:20 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
Releases
10 releases since Debian 4.0 (Etch); the text changed 9 times.