Creating GRASS Database
From IOSN-InWent FOSS GIS & Sahana Training
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:

Using EPSG Method
- Press the "EPSG Codes" button.
- Set new location name ("mentawai_1") and click "Browse" button.
- Define your location (depend on your map location, for example we're using 32747).
We can get the ESPG code from:- You can use search feature to find the EPSG code. Then click "Grab Code" button.
- You can use qGIS, open your map and the access menu: Settings > Project Properties > Projection
- You also can use http://www.epsg-registry.org
- Press "Define Location" button.
- There'll be a warning window, but's that's OK (normal). We'll asked to restart our GRASS.
- Re-open GRASS from terminal:
$> grass - 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.
- 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
- Click "Projection Values" button.
- Grass will switch to terminal/console mode with some text based wizard
- Create new location by filling "mentawai_2" to LOCATION, hits ESC+RETURN
- Would you like to create location <mentawai_2> ? (y/n) [y], hits RETURN
- 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 - Coordinate System? UTM, hits C then RETURN
- One line description? "Mentawai UTM Zone 47 South", hits RETURN
- Enter geodetic datum? yes, hits RETURN
- Please specify datum name? type "wgs84" then hits RETURN
- Datum Transformation Parameters? type "1" then hits RETURN
- Enter Zone? type "47" then hits RETURN
- Is this South Hemisphere? yes, hits RETURN
- 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:
So, our entries will be:
North: 9818459.444
South: 9564913.077
East: 815918.631
West: 529311.716
hits ESC+RETURN - 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 - We'l asked to review the information, select y then hits ESC+RETURN
- Press CTRL+C to quit from the GRASS terminal
- Re-open GRASS from terminal:
$> grass - 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.
- 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

