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

You may work on this assignment as a group. If anything does not work as described here, notify the instructor immediately. In this assignment, you will add layers for boat ramps and campgrounds in Oregon to the map interface of the fishing_v2 application.

The schema diagram for the fishing_v2 database is available at http://web.engr.orst.edu/~minoura/cs549/ass/ as Visio file fishing_v2_schema_2.vsd.

Part I Adding a Map Layer for Boat Ramps and Generating Web Scripts for Them

  1. We first add a layer for boat ramps to the map interface.

    1. Download a shapefile for boat ramps in Oregon from
      http://www.oregon.gov/DAS/EISPD/GEO/alphalist.shtml
      
    2. Decompress the downloaded file into a shapefile, which actually is a collection of multiple files with extensions .dbf, .prj, .sbx, .shx, .sbn, and .shp.

    3. Convert the shapefile into a file containing SQL statements that can be executed on a PostgreSQL database with the PostGIS extension. For this purpose, use the following Unix command
      shp2pgsql -s 2992 shapefile-name your-table-name > sql-file-name
      
      Name your table for the boat ramps as your-name_boat_ramps. If you want to know the available options for shp2pgsql, just issue Unix command shp2pgsql.

    4. After connecting to database fishing_v2, create your table for boat ramps by executing the SQL statements as user cs540. Note that you are sharing the fishing_v2 database with other students, and that each student creates his own table for boat ramps.

    5. Add the two map layers for the boat ramps in the gmap75_oregon.map, one layer for normal display, and the other for highlighting.

    6. Add an entry for the layer of boat ramps to file oregon_maplayers.php in ms_apps/fishing_v2/map_layers_config. The layer entry for the boat ramps in the map legend is created by this entry.

    7. If the preceding steps are correctly carried out, boat ramps are correctly displayed on the map interface.

  2. You can now generate form-scripts for your table for boat ramps.

    1. Create a directory boat_ramp in fishing_v2/forms. In that directory, execute the following commands in directory:
        mmconfgen -f your-name_boat_ramp
        mconfgen  -f your-name_boat_ramp
        confgen   -f your-name_boat_ramp
        layoutgen -f your-name_boat_ramp
        webgen    -f your-name_boat_ramp
      
      You may customize your form scripts by modifying the your-name_boat_ramp.mconfig file. Once the meta configuration file is manually modified for customization, do not execute mmconfgen or mconfgen from that point.

    2. When new tables are added to the database, You can insert the entries for the newly created tables in table data_admin_table by executing the command:
        php insert_data_admin_table.php
      
      When the subdirectories for the Web scripts for tables are added or renamed, those subdirectories can be correctly registered in table data_admin_table with the command:
        php fill_dir.php
      
      If those subdirectories are not correctly registered, the forms cannot be opened from the Data Administration page. The PHP scripts above can be executed repeatedly.

    3. You can manually link a table to a category by adding an entry in table data_admin_category_table as follows.

      1. Open
        http://www.engr.orst.edu/~your-login/
             ms_apps/fishing_v2/forms/data_admin2/index_top.php
        
      2. Click the tree icon for category Data Administration to open the data administration treeview.

      3. Once the treeview for the data administration is opened, click the + icon to expand the Categories node.

      4. If you want to add a new category, right-click the Categories node. Specify the category to be created in the Insert D Data Admin Category page.

      5. Click the + icon to expand the node for a category to see the tables in that category.

      6. To link a table to a category, right-click the node for that category and select the Insert Link option. Specify the table to be linked in the Insert Data Admin Category Table page.

      7. Refresh the treeview.

      Provide a screenshot of the map interface displaying some boat ramps based on the data in your table for boat ramps and screenthots of a few forms displaying information of some boat ramps. The URLs must be recognizable.

    Part II Adding a Table and a Map layer for Campgrounds

    1. Try to locate GIS data for campgrounds in Oregon, preferably polygon data. If you cannot find them, work with several sample data collected from the Web or recreation guides.

    2. Provide the columns indicated below for the campground table.

      1. name, which is the name of the campground.

      2. d_county_id, which is the ID of the county where the campground is located. The fishing_v2 database contains table d_county.

      3. waterbody_id, which is the ID of the adjacent waterbody. A campground is adjacent to at most one waterbody. Table waterbody is currently the superclass table of tables river, lake, sea shore, and ocean.

      4. number_of_campsites, which indicate the number of available campsites.

      5. drinking_water, whose boolean values indicate the availability of drinking water.

      6. rest_room, whose boolean values indicate the availability of rest rooms.

      7. Other columns included in the downloaded data.

      8. the_geom, whose values are polygons or multipolygons representing the shapes of the campgrounds.

    3. The rest of the steps are similar to those listed for the boat ramp layer.