P13 GRASS

P13_Manipulation_and_analysis|P13 Manipulation and analysis


 * Set the working environment

database = /path/to/grassdata location = pirronord_xyz mapset = p13 region =


 * Connect GRASS to PostgreSQL (db.connect)

References: db.connect db.login db.tables db.describe db.columns

GRASS 6.4.2 (pirronord_xyz):~ > > db.connect driver=pg database="host=localhost,dbname=p13" schema="public" --verbose > db.login user=dncgst > db.connect -p > db.tables -p > db.describe -t table=public.points > db.columns table=public.points


 * Import geometry points (v.in.ogr)

References: v.in.ogr

GRASS 6.4.2 (pirronord_xyz):~ > v.in.ogr dsn=PG:dbname=p13 layer=points output=p13_points -e -z


 * Show current region (g.region)

References: g.region

GRASS 6.4.2 (pirronord_xyz):~ > > g.region -3p projection: 0 (x,y) zone:      0 north:     3.072 south:     1.039 west:      3.141 east:      8.995 top:       1.63400000 bottom:    -2.52500000 nsres:     1.0165 nsres3:    1.0165 ewres:     0.97566667 ewres3:    0.97566667 tbres:     1.03975 rows:      2 rows3:     2 cols:      6 cols3:     6 depths:    4 cells:     12 cells3:    48


 * Alternative vector points import from db (v.in.db)

References: v.in.db v.db.select v.info

GRASS 6.4.2 (pirronord_xyz):~ > > v.in.db --v driver=pg database="host=localhost,dbname=p13" table=public.points x=x y=y z=z key=id output=points_v_in_db > v.db.select points_v_in_db > v.info -t points_v_in_db


 * Add a base grid (v.mkgrid)

References: v.mkgrid

GRASS 6.4.2 (pirronord_xyz):~ > > v.mkgrid --verbose map=p13_grid grid=3,6 position=coor coor=3.00,1.00 box=1,1


 * Add a base raster to be able to view the points in NVIZ

GRASS 6.4.2 (pirronord_xyz):~ > > r.mapcalc "bottom = "


 * Import attribute tables (db.in.ogr)

References: db.in.ogr

GRASS 6.4.2 (pirronord_xyz):~ > db.in.ogr dsn="PG:host=localhost dbname=p13 user=dncgst" db_table=records output=p13_records