440 likes | 576 Views
Automatic Generation of Web-Based GIS/Database Applications. Nirut Chalainanont Junya Sano Toshimi Minoura Department of Computer Science Oregon State University Corvallis, Oregon, 97331-4602 minoura@eecs.orst.edu. Outline. Web-based GIS/database applications WebGD Framework
E N D
Automatic Generation of Web-Based GIS/Database Applications Nirut Chalainanont Junya Sano Toshimi Minoura Department of Computer Science Oregon State University Corvallis, Oregon, 97331-4602 minoura@eecs.orst.edu
Outline • Web-based GIS/database applications • WebGD Framework • Automatic generation of Web-form scripts • Automatic generation of map-layer configuration files • Conclusions
Capabilities of WebGD Applications • Geographical features can be inserted, queried, and deleted from a map interface. • A map interface and Web-form scripts can be automatically generated. • Dynamic switching of spatial references is supported.
Capabilities of WebGD Applications (cont’d) • GIS data in an area selected by the user can be exported as a shapefile. • A treeview can be automatically created. • A PDF file containing the map image and data retrieved from the database can be created. • Photo images can be uploaded.
WebGD Architecture PHP scripts create the map object and access the database. Web Browser Defines PHP classes for GIS objects. PHP Web Server PHP/MapScript Provides functions to manage geospatial data MapServer PostGIS Generates map images. PostgreSQLDatabase Stores geospatial and business data.
PostgreSQL • The object-relational feature of PostgreSQL simplifies manipulation of geographical objects: select gid from sites where geom_col && setSRID(BOX2D(10 20, 80 90)::box2d, 6010)); select X(geom_col), Y(geom_col) from sites where gid = 100;
Dynamic Switching of Spatial References • World Longitude/Latitude • North America Albers Equal Area • California UTM 10 and 11 • Oregon Lambert Conformal Conic
Dynamic Switching of Spatial References • The world is divided into regions with sizes ranging from the entire world to a state/province in a country. • Each region has an associated rank number. • Each time a user changes the extent by zooming or panning, many regions may cover the new map extent. The region with the largest rank number, which is normally the smallest region that includes the extent, is selected
Selecting a Region Region 1 (rank 1) Region 2 (rank 11) Region 2 selected Region 3(rank 12) Region 3 selected Region 1 selected
WebGD Framework • A collection of scripts common to all WebGD applications • Customizable with configuration files • Sever-side scripts written in PHP • Client-side scripts written in JavaScript
Region Configuration • Map projection • Unit distance of measurement • Name of the map file for the region • Name of the map layer configuration file • Name of quick view configuration file
Map Layer Configuration The following information is kept for each map legend entry: • Spatial reference ID • Geometry type • Icon and label for the layer • Database table associated with the layer • Actions associated with the layer
Quick View Configuration The quick view mechanism allows the user to go to a predefined area directly: • Spatial reference for each area • Extent of each area • Name of each area
WegGD Application Generator • WebGD-Gen automatically generates a consistent set of Web scripts from configuration files, including those for a map interface. • Configuration files are again automatically generated from a relational database schema. • The cost of application development is greatly reduced.
WebGen TreeGen Configuration Configuration File File Search Search Template Script Select Select Template Script Edit Edit Template Script Info Info Template Script Action Action Template Script TreeView TreeView Template Script Form Script Generation Process
Linked Forms Department Select Form Selected ID Department Search Form Student Edit Form Department Edit Form Course Select Form
WebGen Configuration File • $search_fieldsfor the search script. • $search_fields, $select_fields and$search_join_tables for the select script • $edit_fields for the edit script • $info_blocks for information script
$search_fields $search_fields=array( array("column"=>"student_id", "label"=>"Student ID", "type"=>"numeric", "maxlen"=>"40", "size"=>"40"), array("column"=>"first_name", "label"=>"First Name", "type"=>"text", "maxlen"=>"40", "size"=>"40"), . . . );
$search_join_tables joined_tableindicates the associated table linked to the anchor table: $search_join_tables = array( "departments" => array( "joined_table"=> "departments ON departments.department_id = students.department_id", "used"=>"false", "select"=>"true"), );
Configuration Parametersfor a Map Interface • WebGD-Gen can generate the statements for inserting, searching, and deleting geographical features from the following lines in a Web-script configuration file: $web_gd = ‘MULTIPOLYGON’; $layer_name = ’grp_eo_py’; $geometry_column = ‘the_geom’; $gid_column = ‘gid’; $db_table_srid = 32119;
Process of Creating Map-Layer Configuration File for Region xxx Database Map File map_mconfgen xxx_maplayer.mconfig User Customization Customized xxx_maplayer.mconfig map_confgen xxx_maplayer.config
Map-Layer Meta Configuration File • The default map-layer meta configuration file is created by map_mconfgen from • table geometry_columns in the database and • the layer-group names in the map file • User can customize the meta configuration file.
Meta Configuration File • Default meta configuration file • User customized meta configuration file 'grp_eo_py' => array( 'layer_selectable' => true, 'legend_label' => 'Eo Py', ), 'grp_eo_py' => array( 'layer_selectable' => true, 'legend_label' => 'EO Polygons', 'search_script' => 'forms/eo/eo_py_search.phtml', 'select_script' => 'forms/eo/eo_py_select.phtml', 'edit_script' => 'forms/eo/eo_py_edit.phtml', 'img_src' => 'images/eo_poly.png', ),
Map-Layer Configuration File • map_confgengenerates the map-layer configuration file by applying customized data in the meta configuration file to the meta data retrieved from • table geometry_columns in the database and • the layer-group names in the map file
Definition of a Layer Configuration 'grp_eo_py' => array( 'geom_type' => ‘POLYGON', 'table' => 'eo_py', 'layer_selectable' => true, 'legend_label' => 'EO Polygons', 'geom_col' => 'the_geom', 'gid_column' => 'gid', 'normal_layer' => 'eo_py', 'img_width' => 26, 'img_height' => 26, 'img_src' => 'images/eo_poly.png', 'data_srid' => 32119, 'search_script' => 'forms/eo/eo_py_search.phtml', 'select_script' => 'forms/eo/eo_py_select.phtml', 'edit_script' => 'forms/eo/eo_py_edit.phtml', 'searched_layer' => 'eo_py_searched', 'checked_layer' => 'eo_py_checked', 'selected_layer' => 'eo_py_selected', 'onclick' => 'activate_layer("grp_eo_py")', ),
Conclusions Web-based GIS/database applications have a great potential for user-participatory applications. • Users can add geographical features and associated data with Web browsers. • The major part of creating a WebGD application can be automated. • The whole world or the entire USA can be seamlessly covered.
Dileep Arur Haris Gunadi Surya Halim Hong Gyu Han Mariko Imaeda Junya Sano Akash Sharma Hiroshi Tashiro Naroot Wanalertlak Paphun Wangmutitakul Teerawat Wuttiwat Acknowledgement
URL http://yukon.een.orst.edu/