Creating GRASS Database

From IOSN-InWent FOSS GIS & Sahana Training

Jump to: navigation, search

Contents

Introduction

GRASS (Geographic Resources Analysis Support System,http://www.grass-gis.org) is a free, open source Geographical information system (GIS) capable of handling raster, topological vector, image processing, and graphic data.

There were 3 methods to make GRASS Database:

  • Using geo-referenced files
  • Using EPSG
  • Using projection info

All of those 3 methods will produce spatial information that needed to create GRASS Database:

  • Coordinate System
  • Map Projection
  • Resolution
  • Boundary

Starting GRASS

Start your GRASS using terminal:

$> grass

Set your GRASS database (it's a directory) to our training convention:
Image:Screenshot-GRASS 6.2.2 Startup.png

Using EPSG Method

  1. Press the "EPSG Codes" button.
  2. Set new location name ("mentawai_1") and click "Browse" button.
    Image:Screenshot-Define location using EPSG projection codes.png
  3. Define your location (depend on your map location, for example we're using 32747).
    We can get the ESPG code from:
    1. You can use search feature to find the EPSG code. Then click "Grab Code" button.
    2. You can use qGIS, open your map and the access menu: Settings > Project Properties > Projection
      Image:Screenshot-Project Properties.png
    3. You also can use http://www.epsg-registry.org
  4. Press "Define Location" button.
  5. There'll be a warning window, but's that's OK (normal). We'll asked to restart our GRASS.
  6. Re-open GRASS from terminal:
    $> grass
  7. Select project location that we created ("mentawai_1"), that location only have 1 mapset ("PERMANENT"), now we need to add new mapset for our working mapset. Fill the "Create new mapset from selected location" form entry with some name (we'll use our Ubuntu username for this: "fossgis" or "instruktur"). Press the "Create New Mapset" button.
    Image:Screenshot-GRASS 6.2.2 Startup-1.png
  8. To start our new GRASS session, select our location ("mentawai_1") and select our mapset ("fossgis" or "instruktur"), press "Enter GRASS" button.


Using Projection Values Method

  1. Click "Projection Values" button.
  2. Grass will switch to terminal/console mode with some text based wizard
    Image:Screenshot-instruktur@instruktur.ristek.go.id- -var-www-wiki.png
  3. Create new location by filling "mentawai_2" to LOCATION, hits ESC+RETURN
  4. Would you like to create location <mentawai_2> ? (y/n) [y], hits RETURN
  5. Next step we'll asked if we have information about some information. To get those information we can use this commandline from our converted raster image:
    $> gdalinfo /home/USERNAME/maps/raster/srtm/SRTM_MENTAWAI_UTM.tif
  6. Coordinate System? UTM, hits C then RETURN
  7. One line description? "Mentawai UTM Zone 47 South", hits RETURN
  8. Enter geodetic datum? yes, hits RETURN
  9. Please specify datum name? type "wgs84" then hits RETURN
  10. Datum Transformation Parameters? type "1" then hits RETURN
  11. Enter Zone? type "47" then hits RETURN
  12. Is this South Hemisphere? yes, hits RETURN
  13. Then fills the entry region form using coordinates that we can grabbed from gdalinfo.
    Corner Coordinates:
    Upper Left ( 529311.716, 9818459.444) ( 99d15'48.68"E, 1d38'32.76"S)
    Lower Left ( 529311.716, 9564913.077) ( 99d15'50.53"E, 3d56'10.55"S)
    Upper Right ( 815918.631, 9818459.444) (101d50'20.65"E, 1d38'25.52"S)
    Lower Right ( 815918.631, 9564913.077) (101d50'40.44"E, 3d55'53.18"S)
    Center ( 672615.174, 9691686.261) (100d33'10.39"E, 2d47'18.09"S)

    Means like this in display:
    Image:Screenshot-2.png
    So, our entries will be:
    North: 9818459.444
    South: 9564913.077
    East: 815918.631
    West: 529311.716
    hits ESC+RETURN
  14. Then fills the grid resolution form using another information that we grabbed from gdalinfo:
    Pixel Size = (30.811321746802712,-30.811321746802712)
    So, our entries will be:
    East-West: 30.8113217
    North-South: 30.8113217
    hits ESC+RETURN
  15. We'l asked to review the information, select y then hits ESC+RETURN
  16. Press CTRL+C to quit from the GRASS terminal
  17. Re-open GRASS from terminal:
    $> grass
  18. Select project location that we created ("mentawai_2"), that location only have 1 mapset ("PERMANENT"), now we need to add new mapset for our working mapset. Fill the "Create new mapset from selected location" form entry with some name (we'll use our Ubuntu username for this: "fossgis" or "instruktur"). Press the "Create New Mapset" button.
    Image:Screenshot-GRASS 6.2.2 Startup-1.png
  19. To start our new GRASS session, select our location ("mentawai_2") and select our mapset ("fossgis" or "instruktur"), press "Enter GRASS" button.


On to Step 5: Creating XY Database

Personal tools