Creating GRASS Database2

From IOSN-InWent FOSS GIS & Sahana Training

Jump to: navigation, search

Contents

Starting GRASS

  1. Open GRASS from terminal:
    $> grass
  2. To start our new GRASS session, select our location ("mentawai_2") and select our mapset ("fossgis" or "instruktur"), press "Enter GRASS" button.
    Image:Screenshot-GRASS 6.2.2 Startup-1.png

Connecting Database

  1. Use menu Databases > Manage Database > Connect Database > Connect to Database
    Image:Screenshot-GRASS6.2.2 GIS Manager - mentawai 2 instruktur-1.png
  2. Set the database driver to "pg" and enter your database name (we use "mentawai")
    Image:Screenshot-db.connect.png
  3. Press the "Run" button, then we can check the progress on GRASS's output windows
    Image:Screenshot-Output - GIS.m.png
  4. Connection successful

Login Into Database

  1. 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.
  2. Use menu Databases > Manage Database > Connect Database > Login to Database
    Image:Screenshot-GRASS6.2.2 GIS Manager - mentawai 2 instruktur.png
  3. Insert the database ("fossgiss" or "instruktur") username and password ("ristek")
    Image:Screenshot-db.login.png
  4. Press the "run" button, then we can check the progress on GRASS's output windows
    Image:Screenshot-Output - GIS.m-1.png
  5. Our login information has been stored by GRASS, but is it correct? GRASS provides some connection test feature.
  6. Use menu Databases > Manage Database > Connect Database > Test Database
    Image:Screenshot-GRASS6.2.2 GIS Manager - mentawai 2 instruktur-2.png
  7. Select the test1 tester, press "Run" and then check the output window
    Image:Screenshot-Output - GIS.m-2.png

Importing Data from Vector Map

  1. Use menu File > Import > Vector Map > Various Format Using OGR
    Image:Screenshot-GRASS6.2.2 GIS Manager - mentawai 2 instruktur-3.png
  2. 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"
    Image:Screenshot-v.in.ogr-1.png
  3. Check the output window
    Image:Screenshot-Output - GIS.m-3.png
  4. Using pgadmin, check is there new table named jalan_mentawai (or any name we add when importing vector map)
    Image:Pgjalan.png

Displaying the Vector Layer

  1. Add the vector layer by clicking it's icon (1), select the added new layer (2).
    Image:Importvector.png
    Click the vector map icon (3) to select which map will be displayed (4).
  2. Select the Map Display window to display the new map
    Image:Vectorjalandisplay.png


On to Step 7: Importing Raster