Creating GRASS Database2
From IOSN-InWent FOSS GIS & Sahana Training
Contents |
Starting GRASS
- Open GRASS from terminal:
$> grass - To start our new GRASS session, select our location ("mentawai_2") and select our mapset ("fossgis" or "instruktur"), press "Enter GRASS" button.
Connecting Database
- Use menu Databases > Manage Database > Connect Database > Connect to Database
- Set the database driver to "pg" and enter your database name (we use "mentawai")
- Press the "Run" button, then we can check the progress on GRASS's output windows
- Connection successful
Login Into Database
- Previous steps only makes us can connect to the "mentawai" database, now we'll need to set up GRASS to be able to do database operation in our table.
- Use menu Databases > Manage Database > Connect Database > Login to Database
- Insert the database ("fossgiss" or "instruktur") username and password ("ristek")
- Press the "run" button, then we can check the progress on GRASS's output windows
- Our login information has been stored by GRASS, but is it correct? GRASS provides some connection test feature.
- Use menu Databases > Manage Database > Connect Database > Test Database
- Select the test1 tester, press "Run" and then check the output window
Importing Data from Vector Map
- Use menu File > Import > Vector Map > Various Format Using OGR
- Open our UTM file (browse from /home/username/maps/vector/...), set the name for it and checked the "line" option for vector data, press "Run"
- Check the output window
- Using pgadmin, check is there new table named jalan_mentawai (or any name we add when importing vector map)
Displaying the Vector Layer
- Add the vector layer by clicking it's icon (1), select the added new layer (2).

Click the vector map icon (3) to select which map will be displayed (4). - Select the Map Display window to display the new map
On to Step 7: Importing Raster

