The input is read from a file specified by input option or from standard input.
A GRASS ASCII vector file (in standard mode) may contain a mix of primitives including points, lines, boundaries, centroids, areas, faces, and kernels.
The primitive codes are as follows:
Importing from a spreadsheet
Data may be imported from many spreadsheet programs by saving the
spreadsheet as a comma separated variable (.csv) text file, and then
using the "fs=," option with v.in.ascii in points mode.
Import of category attributes in standard mode
The user has to create a database table directly (with db.execute)
and then link it to vector map:
db.execute ... # (CREATE TABLE ..., INSERT INTO ....) v.db.connect ... # link table to vector map)
ORGANIZATION: GRASS Development Team DIGIT DATE: 1/9/2002 DIGIT NAME: - MAP NAME: test MAP DATE: 2002 MAP SCALE: 10000 OTHER INFO: Test polygons ZONE: 0 MAP THRESH: 0.500000 VERTI: A 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 A 4 5959010.9323622 3401338.36037757 5959096.7459483 3401370.54047235 5959091.38259917 3401450.99070932 5959010.9323622 3401338.36037757
Example 2
Generate a 2D points vector file 'coords.txt' as ASCII file:
1664619|5103481 1664473|5095782 1664273|5101919 1663427|5105234 1663709|5102614
Import into GRASS:
cat coords.txt | v.in.ascii out=mymap
Example 3
Generate a 2D points vector file 'points.dat' as ASCII file:
1|1664619|5103481|studna 2|1664473|5095782|kadibudka 3|1664273|5101919|hruska 4|1663427|5105234|mysi dira 5|1663709|5102614|mineralni pramen
Import into GRASS:
cat points.dat | v.in.ascii out=mypoints xcol=2 ycol=3 catcol=1 columns='cat int, x double, y double, label varchar(20)'
The module is reading from standard input, using the default '|' (pipe) delimiter.
Example 4
Generating a 3D points vector map from DBMS (idcol must be an integer column):
echo "select east,north,elev,idcol from mytable " | db.select -c | v.in.ascii -z out=mymapThe module is reading from standard input, using the default '|' (pipe) delimiter.
Example 5
Generate a 3D points vector file 'points3d.dat' with attributes as ASCII file:
593493.1|4914730.2|123.1|studna|well 591950.2|4923000.5|222.3|kadibudka|closet 589860.5|4922000.0|232.3|hruska|pear 590400.5|4922820.8|143.2|mysi dira|mouse hole 593549.3|4925500.7|442.6|mineralni pramen|mineral spring 600375.7|4925235.6|342.2|kozi stezka|goat path
Import into GRASS:
cat points3d.dat | v.in.ascii -z zcol=3 catcol=0 out=mypoints3D \ columns='x double, y double, z double, label_cz varchar(20), label_en varchar(20)' v.info -c mypoints3D v.info mypoints3DAn additional column 'cat' will be automatically added when catcol=0 (in case that no IDs are present in the input file).
The GRASS program v.out.ascii performs the function of v.in.ascii in reverse; i.e., it converts vector files in binary format to ASCII format. These two companion programs are useful both for importing and exporting vector files between GRASS and other software, and for transferring data between machines.
Last changed: $Date: 2004/11/05 09:53:29 $