Note: A new GRASS GIS stable version has been released: GRASS GIS 7. Go directly to the new manual page here
v.in.db driver=pg database="host=myserver.itc.it,dbname=mydb" \ table=pat_stazioni x=east y=north z=quota key=id output=pat_stazioni
If an ID column is not present in the PostgreSQL table, a new column should be added. See pg driver page for detail.
v.in.db driver=pg database="host=myserver.itc.it,dbname=mydb" \ table=station x="x(geom)" y="y(geom)" z="z(geom)" key=id out=meteostations
If an ID column is not present in the PostgreSQL table, a new column should be added. See pg driver page for detail.
#create vector map from DBF table (here, 'idcol' contains unique row IDs, 'z' is optional): #the 'database' parameter is the directory where the DBF file is stored: v.in.db driver=dbf database=/home/user/tables/ table=pointsfile x=x y=y z=z \ key=idcol out=dtmpoints #check result: v.info dtmpoints v.info -c dtmpoints
If an ID column is missing in the DBF file, it has to be added beforehand, e.g. with OpenOffice. Alternatively, import the table with db.in.ogr into GRASS and then with v.in.db from the imported table (db.in.ogr optionally adds an unique ID column).
#create vector map from table in SQLITE database file (here, 'idcol' contains unique row IDs, 'z' is optional): #the 'database' parameter is the the SQLite database file with path: v.in.db driver=sqlite database=/home/user/tables/mysqlite.db table=pointsfile x=x y=y z=z \ key=idcol out=dtmpoints #check result: v.info dtmpoints v.info -c dtmpoints
If an ID column is missing in the table, it has to be added beforehand with 'sqlite3' or db.execute.
The user can import only selected vector points from a table using the where parameter (see above for general DBF handling):
v.in.db driver=dbf database=/home/user/tables/ table=pointsfile x=x y=y z=z \ key=idcol out=dtmpoints where="x NOT NULL and z > 100"
Last changed: $Date: 2014-05-11 14:13:16 -0700 (Sun, 11 May 2014) $
Main index - vector index - Full index
© 2003-2016 GRASS Development Team