CS 549, Spring 2008
Assignment #2
(total = 20 pts., due on April 14, Monday)

You may work as a group on Parts I and II of this assignment, but you must work individually on Part III. If anything does not work as described here, notify the instructor immediately.

Part I: Checking out Required Software (0 pts.)

In this part of the assignment, you will check out the WebGen environment and the fishing_v2 application. If you have checked out some of those modules earlier, you only need to update them.
  1. In order to make the CS 540, not CS 549, CVS repository work for you, add the following lines to your .bashrc file in your home directory:
    export PATH=$PATH:~/bin:.:../../../web_gen
    export CVSROOT=:ext:your-login-name@amazon.een.orst.edu:/home/cvs_cs540
    export CVS_RSH=ssh
    
    You may also add the following statement to let your Unix prompt indicate the host name and the full path of your working directory:
    export PS1="\h \w \!% "
    
    Then issue Unix command source ~/.bashrc or open a new terminal.

  2. If your shell program is csh or tcsh, make the following changes to file .cshrc:
    set    path=($path ../../../web_gen)
    setenv CVSROOT :ext:cs540@amazon.een.orst.edu:/home/cvs_cs540
    setenv CVS_RSH ssh
    
  3. Create directory public_html, and check out from the CVS repository the required modules by issuing the following commands:
    cd ~/public_html
    cvs co -P ms_apps/framework_v3
    cvs co -P ms_apps/web_gen
    cvs co -P ms_apps/treeview
    cvs co -P ms_apps/app_skeleton
    cvs co -P ms_apps/fishing_v2
    
    Use your password on amazon.een.orst.edu. Please do not check in any modified files without first talking to the instructor.

  4. From now on, you may periodically update the files checked out from the CVS repository by issuing the following commands. If any WebGen command fails, do this first.
      cd ~/public_html/ms_apps
      cd framework_v3
      cvs up -d
      cd ../web_gen
      cvs up -d
      cd ../treeview
      cvs up -d
      cd ../app_skeleton
      cvs up -d
      cd ../fishing_v2
      cvs up -d
    
  5. You may edit manually the forms/datasource.php file so that it provides correct database connection parameters such as
        $Database_Host = "localhost";
        $Database_Name = "your_fishing_v2";
        $Database_User = "cs540";
        $Database_Password ="CSxyz540";
        $Database_Type = "PgSQL";             // PgSQL or MySQL
    

Part II (10 pts.)

For each of the geometry types POINT, LINESTRING, and POLYGON, create a table that includes a geometry column of that type. For example, the tables may be for fishing spots, rivers, and camp grounds.
  1. You may create tables fishing_spot_point and river by executing SQL script create_fishing_tables.sql in ~/public_html/ms_apps/fishing_v2/sql_queries/. Since a table for campgrounds is not created by this script, you must create it yourself.

  2. Populate each of those tables with some sample records. The records must be able to produce meaningful results for the queries formulated in Part III.

  3. Create an index on each geometry column, if missing. How to create a spatial index is described in Section 4.5 of the online PostGIS Manual.

Part III (10 pts.)

Test three PostGIS functions assigned to you, and make a presentation on them. PostGIS functions are described in Chapter 6 of the online PostGIS Manual.

Assignment of PostGIS Functions: