Creating XY Database

From IOSN-InWent FOSS GIS & Sahana Training

Jump to: navigation, search

If we don't have any proper map source (landsat map. detailed map from official land mapping or geographical institution etc.), we still can use map from GoogleMap or GoogleEarth. Now we'll learn how to create XY Database using GRASS.

Getting Information

$> gdalinfo /home/instruktur/maps/raster/google-images/Siberut.jpg 

Driver: JPEG/JPEG JFIF
Size is 1164, 784
Coordinate System is `'
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 784.0)
Upper Right ( 1164.0, 0.0)
Lower Right ( 1164.0, 784.0)
Center ( 582.0, 392.0)
Band 1 Block=1164x1 Type=Byte, ColorInterp=Red
Band 2 Block=1164x1 Type=Byte, ColorInterp=Green
Band 3 Block=1164x1 Type=Byte, ColorInterp=Blue

Creating Database

  1. Start grass from terminal:
    $> grass
  2. Select "Projection Values", we'll back to GRASS's text based wizard
  3. LOCATION? "mentawai_xy" hits ESC+ENTER
  4. Coordinate System? select x,y , press a hits ESC+ENTER
  5. Enter the description? "Mentawai Google Earth" hits ESC+ENTER
  6. Define the region? set north=0, south=-1, west=0, east=1, resolution=1 hits ESC+ENTER
  7. East-West Resolution = 1 ; North-South Resolution = 1
  8. Press CTRL+C to quit from the GRASS terminal
  9. Re-open GRASS from terminal:
    $> grass
  10. Select project location that we created ("mentawai_xy"), 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
  11. To start our new GRASS session, select our location ("mentawai_xy") and select our mapset ("fossgis" or "instruktur"), press "Enter GRASS" button.
  12. Now let's import our google images to GRASS by accessing menu: Files > Import > Raster Map > multiple Formats using GDAL
  13. Browse the source map (from /home/username/maps/raster/google-images) and press "Run" button
    Image:Screenshot-r.in.gdal.png

Viewing The Imported Image

  1. Re-open GRASS from terminal:
    $> grass
  2. Select project location that we created ("mentawai_xy") and select our mapset ("fossgis" or "instruktur"), press "Enter GRASS" button.
  3. Press "Add Raster" icon button (Step 1)
    Image:Screenshot-3.png
  4. Select the raster layer (Step 2)
  5. On the information window below the raster layer list, click basemap (Step 3), another window will open
  6. Select the red layer (Step 4)
  7. Now move to "Map Display Window", if our map not shown yet: choose "Zoom to Selective Map"
    Image:Screenshot-4.png


On to Step 6: Creating GRASS Database2