IDRISI - Database Workshop



 

File: c: iomega(course):\aacrse\505\id\ex7\id78dbs.rtf; Earthnt\users\ES300b\id\ex7

    The Awrajas area has been divided into a set of irregular polygonal areas to which has been 'attached' a set of averaged point hydrologic and geological characteristics: rain fall, pumping rates, soil character, underlying rock type, water chemistry, permeability, degree of weathering, etc. (Note: the drawing objects displayed in the image could just as well be 'point' objects as polygons.) By convention, each polygon has a geographic identifier which can be linked to a similar variable in an attribute values file. In this exercise, the attribute values file is an external ACCESS database. The aim of this exercise is to show how to access a record in the database by 'pointing' to a polygon in the image, or, alternatively,  to highlight a polygon(s) in the image through the selection of a record in the database. In the first case, this is called creating a backward link - clicking any polygon in the image to retrieve the corresponding record in the database. In the second case, the procedure is called creating a forward link - querying a record in the data base to display the corresponding polygon in the linked image.

    Procedure:

    1) Go to your folder in ‘users on ‘Earthnt’ (H:)’, where ‘H’ is the name of the mapped drive Earthnt\Users on your computer (it could be some letter other than ‘H’, or it may not exist and will have to be created), and make a folder named ‘your initials7KEEP READING! - (do not include the quotes, and ‘your initials’ really means your initials, e.g. wrc7, and not the string ‘yourinitials’). If you have not previously used the computers in room 17 or 53 and are baffled by this instruction, request the help of the instructor.

    2) Create a window corresponding to ‘Earthnt\Public\505\idr\ex7' and copy the contents of the folder into the folder you have just created in your area by clicking and dragging the files from the ‘Public’ window into the ‘Users’ window (Click (highlight) the first file, hold down the shift key and click the last file; click and drag the file set to the 'Users' window.)

    3) In IDRISI set the Evironment to "mapped drive letter:\users\yourname\yourinitials7"


    A) DISPLAY THE RASTER IMAGE AND OVERLAY THE VECTOR LAYER

    Display (Display - Display Launcher) the AWRAJAS polygon image using the awrajas.smp palette. Also select to display the Legend and Title by clicking the requisite buttons in the Map components box.

    The polygons represent 14 polygons each made up of a subset of smaller polygons. Examine the palette and note that the autoscale limit has been set from 0 to 15, and that therefore only the first 15 tiles (0 to 14) of the palette have been set to a colour (0= white, 14 = grey); all higher value tiles being set to grey. Since the identifiers of the polygons have values ranging from 100 to 1402, autoscaling sets all polygons with values in the range 100 to 199 as colour 1, 200-299 as colour 2, etc, to colour 14 for polygon 1400. The importance of this manipulation is that the image will show the distribution of the larger polygon set, but not the subsets of smaller polygons within the larger polygons.

    From Composer add the AWRAJAS vector layer with the Standard Symbol file. The image should now shows the distribution of the larger polygon set by colour, and of the smaller polygons by their black outlines. Use the Query button to determine the attribute value of the cells within the smaller polygons.

    IMPORTANT: a backward link allows a selection in the image to be transferred to the database; the image in this case is a raster image. A forward link allows a selection in the database to be transferred to the image, but in this case the image used must be a vector image.

    B) SET BACKWARD LINK FROM THE RASTER IMAGE TO THE DATABASE

    Open DATABASE WORKSHOP (Data Entry - Database Workshop) and open (File - Open database) the file AWRAJAS.

    Click the LINK button (last button to the right), or click the LINK menu and select SET DISPLAY LINK PARAMETERS.

    Select LINK# as the ‘field containing feature identifier’ and also as the ‘field containing display codes’.

    Make sure the image is made active and that query button in the main Idrisi tool bar (not the database tool bar) is turned on.

    Click on an area in the AWRAJAS display; the database moves to the record with the corresponding LINK#.

    C) FORWARD LINK BETWEEN THE DATABASE AND THE VECTOR IMAGE

        USING A FIELD OTHER THAN THE FEATURE IDENTIFIER FIELD IN THE DATABASE (e.g. HYDRO_PARA) TO A VECTOR IMAGE

    Click the MODIFY menu item, and select ADD FIELD; add a field called DISPLAY.

    Click MODIFY, select AUTOSCALE, and autoscale the field HYDRO_PARA; the HYDRO_PARA record 101 of 289219 should now appear scaled to a value of 38.

    Select the COMPOSER menu and select the AWRAJA raster image option at the top of the box.

    Select PROPERTIES and change the palette to MASK; this sets the raster image to background on which will be superimposed the filled vector polygons.

    In DATABASE WORKSHOP choose SET DISPLAY LINK PARAMETERS from the LINK menu.

    IMPORTANT: choose LINK# as the feature identifier, and this time select DISPLAY rather than LINK# as the field containing the display symbol codes (1-255).

    In Composer, select the vector image AWRAJAS and PROPERTIES.

    Change the SYMBOL FILE to IDRIS256, click the USE LEGEND button, and choose the USE VALUES FILE option.

    Enter DBWLINK as the values file and 1 as the field.

    Press OK.

    Toggle the chequered display output icon (fifth icon from the left). The value in the   field is now displayed with a different colour for each polygon, colour coded from dark blue (low value) to bright green (high value). Only those polygons with a corresponding record in the database will be displayed. Where there are blank records the green raster image background will be displayed.

    D) USING FILTERS TO QUERY THE IMAGE

    Choose CREATE FILTER in the Query menu.

    Type: where 'HYDRO_PARA 300000' (do not enter the single quotes!).

    Click execute. The diplay will be automatically updated to show only those awrajas with HYDRO_PARA values greater than 300,000.

    To remove the filter, click Remove Filter in the Query menu.

    Query using: 'where Name="Limu" '; (do not enter the single quotes! Case is not respected)

    Try a query with the statement 'where IDR_ID=102 or IDR_ID=901'.

    (What would happen with the statement: 'where IDR_ID=102 and IDR_ID=901'

    NOTE: both the forward and backward links can be run at the same time.

    Appendix

    Database workshop will load Dbase files as well as Access. IDRISI Access database files are however not compatible with Microsoft Office Access97. Access97 will read Idrisi Access files, but cannot modify them, and IDRISI cannot load Access97 files. The IDR_ID field requires that numeric values be integer or double integer. If the IDR_ID field is not integer it cannot be changed, not even if the file is re-cycled via Access97- > Dbase -> Convert to Idrisi Access. The only solution is to create a second ID field in Database Workshop and to manually enter the identifier values into this field.