44
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 [email protected]

Automatic Generation of Web-Based GIS/Database Applications

  • Upload
    kata

  • View
    33

  • Download
    0

Embed Size (px)

DESCRIPTION

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 [email protected]. Outline. Web-based GIS/database applications WebGD Framework - PowerPoint PPT Presentation

Citation preview

Page 1: Automatic Generation of  Web-Based GIS/Database Applications

Automatic Generation of Web-Based GIS/Database

Applications

Nirut ChalainanontJunya Sano

Toshimi Minoura Department of Computer Science

Oregon State UniversityCorvallis, Oregon, 97331-4602

[email protected]

Page 2: Automatic Generation of  Web-Based GIS/Database Applications

Outline• Web-based GIS/database applications

• WebGD Framework

• Automatic generation of Web-form scripts

• Automatic generation of map-layer configuration files

• Conclusions

Page 3: Automatic Generation of  Web-Based GIS/Database Applications

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.

Page 4: Automatic Generation of  Web-Based GIS/Database Applications

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.

Page 5: Automatic Generation of  Web-Based GIS/Database Applications

Natural Heritage Information System

Page 6: Automatic Generation of  Web-Based GIS/Database Applications

Searching in a Selected Area

Page 7: Automatic Generation of  Web-Based GIS/Database Applications

Getting Information

Page 8: Automatic Generation of  Web-Based GIS/Database Applications

Inserting a New Motel

Page 9: Automatic Generation of  Web-Based GIS/Database Applications

Treeview

Page 10: Automatic Generation of  Web-Based GIS/Database Applications

PDF File Generation

Page 11: Automatic Generation of  Web-Based GIS/Database Applications

Uploading Photo Images

Page 12: Automatic Generation of  Web-Based GIS/Database Applications

Web Browser

Web Server

PHP

PHP/MapScript

MapServer

PostgreSQLDatabase

PostGIS

PHP scripts create the map object and

access the database.

Defines PHP classes for GIS

objects.

Generates map images.

Stores geospatial and business data.

Provides functions to manage

geospatial data

WebGD Architecture

Page 13: Automatic Generation of  Web-Based GIS/Database Applications

PostgreSQL

• The object-relational feature of PostgreSQL simplifies manipulation of geographical objects:

select gidfrom siteswhere geom_col && setSRID(BOX2D(10 20, 80 90)::box2d, 6010));

select X(geom_col), Y(geom_col)from siteswhere gid = 100;

Page 14: Automatic Generation of  Web-Based GIS/Database Applications

Dynamic Switching of Spatial References

• World Longitude/Latitude• North America Albers Equal Area• California UTM 10 and 11• Oregon Lambert Conformal Conic

Page 15: Automatic Generation of  Web-Based GIS/Database Applications

World in Longitude/Latitude

Page 16: Automatic Generation of  Web-Based GIS/Database Applications

North America in Albers Equal Area

Page 17: Automatic Generation of  Web-Based GIS/Database Applications

Continental United States in Albers Equal Area

Page 18: Automatic Generation of  Web-Based GIS/Database Applications

Oregon in Lambert Conformal Conic

Page 19: Automatic Generation of  Web-Based GIS/Database Applications

Corvallis in Lambert Conformal Conic

Page 20: Automatic Generation of  Web-Based GIS/Database Applications

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

Page 21: Automatic Generation of  Web-Based GIS/Database Applications

Selecting a Region

Region 1 (rank 1)

Region 1 selected

Region 2 (rank 11)

Region 3(rank 12) Region 3 selected

Region 2 selected

Page 22: Automatic Generation of  Web-Based GIS/Database Applications

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

Page 23: Automatic Generation of  Web-Based GIS/Database Applications

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

Page 24: Automatic Generation of  Web-Based GIS/Database Applications

Region Configuration

$region = array( "gid" => 150137, "name" => "oregon", "display_name" => "Oregon", "srid" => 6010, "rank" => 150137, "units" => "MS_FEET", "mapfile" => "gmap75_oregon.map", "quickview" => "oregon_qview.php", "legend" => "oregon_maplayers.php", "proj4text" => "+proj=lcc +lat_1=43.0 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000.00000 +y_0=0.0” );

Page 25: Automatic Generation of  Web-Based GIS/Database Applications

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

Page 26: Automatic Generation of  Web-Based GIS/Database Applications

Map Layer Configuration

$layer_groups = array ( 'grp_eo_py' => array( 'geom_type' => 'polygon', 'table' => 'eo_py', 'layer_selectable' => true, 'gid_column' => 'gid', 'geom_col' => 'the_geom', 'legend_label' => 'EO Polygons', 'search_script' => 'forms/eo/eo_py_eo_search.phtml', 'select_script' => 'forms/eo/eo_py_eo_select.phtml', 'edit_script' => 'forms/eo/eo_py_edit.phtml', 'normal_layer' => 'eo_py', 'searched_layer' => 'eo_py_searched', 'checked_layer' => 'eo_py_checked', 'selected_layer' => 'eo_py_selected', 'img_src' => 'images/eo_poly.png', 'img_width' => 26, 'img_height' => 26, 'onclick' => 'activate_layer("grp_eo_py")', 'data_srid' => 6010 ), 'grp_eosrc_pt' => array( 'geom_type' => 'point', 'table' => 'eosrc_pt', 'layer_selectable' => true, 'gid_column' => 'gid', 'geom_col' => 'the_geom', 'legend_label' => 'EOSRC Points', 'search_script' => 'forms/eo/eosrc_pt_search.phtml', 'select_script' => 'forms/eo/eosrc_pt_select.phtml', 'edit_script' => 'forms/eo/eosrc_pt_edit.phtml', 'normal_layer' => 'eosrc_pt', 'searched_layer' => 'eosrc_pt_searched', 'checked_layer' => 'eosrc_pt_checked', 'selected_layer' => 'eosrc_pt_selected', 'img_width' => 5, 'img_height' => 5, 'onclick' => 'activate_layer("grp_eosrc_pt")', 'data_srid' => 6010 ), . . .

Page 27: Automatic Generation of  Web-Based GIS/Database Applications

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

Page 28: Automatic Generation of  Web-Based GIS/Database Applications

Quick View Configuration

$qview = array( array( 'name' => 'World', 'srid' => 4326, 'extent' => '-180,-90,180,90' ), array( 'name' => 'United States', 'srid' => 4326, 'extent' => '-125,13,-65,53' ), array( 'name' => 'United States, East', 'srid' => 4326, 'extent' => '-102,22,-60,50' ), array( 'name' => 'United States, West', 'srid' => 4326, 'extent' => '-135,30,-105,50' ), array( 'name' => 'Whole Oregon', 'srid' => 6010, 'extent' => '46461.662375,-43912.968464,2487069.754184,1785176.331408', ), É

Page 29: Automatic Generation of  Web-Based GIS/Database Applications

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.

Page 30: Automatic Generation of  Web-Based GIS/Database Applications

Form Script Generation Process

SearchTemplate

TreeViewTemplate

ActionTemplate

InfoTemplate

EditTemplate

SelectTemplate

TreeGenConfiguration File

WebGenConfiguration File

TreeViewScript

ActionScript

InfoScript

EditScript

SelectScript

Search Script

Page 31: Automatic Generation of  Web-Based GIS/Database Applications

Linked Forms

Student Edit Form

Department Edit Form

Department Search Form

Course Select Form

Selected ID

Department Select Form

Page 32: Automatic Generation of  Web-Based GIS/Database Applications

WebGen Configuration File

• $search_fields for 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

Page 33: Automatic Generation of  Web-Based GIS/Database Applications

Search and Select Forms for Table students

students

PK student_id

first_name last_name full_name age genderFK1 department_idFK2 country_id other_info

Page 34: Automatic Generation of  Web-Based GIS/Database Applications

$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"),

. . .);

Page 35: Automatic Generation of  Web-Based GIS/Database Applications

$search_join_tablesjoined_table indicates 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"),

);

Page 36: Automatic Generation of  Web-Based GIS/Database Applications

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;

Page 37: Automatic Generation of  Web-Based GIS/Database Applications

Process of Creating Map-Layer Configuration File for Region xxx

Database Map File

map_mconfgen

xxx_maplayer.mconfig

User Customization

xxx_maplayer.config

Customized xxx_maplayer.mconfig

map_confgen

Page 38: Automatic Generation of  Web-Based GIS/Database Applications

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.

Page 39: Automatic Generation of  Web-Based GIS/Database Applications

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',),

Page 40: Automatic Generation of  Web-Based GIS/Database Applications

Map-Layer Configuration File

• map_confgen generates 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

Page 41: Automatic Generation of  Web-Based GIS/Database Applications

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")',),

Page 42: Automatic Generation of  Web-Based GIS/Database Applications

Conclusions

• 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.

Web-based GIS/database applications have a great potential for user-participatory applications.

Page 43: Automatic Generation of  Web-Based GIS/Database Applications

Acknowledgement

Dileep ArurHaris GunadiSurya Halim

Hong Gyu HanMariko Imaeda

Junya Sano

Akash SharmaHiroshi Tashiro

Naroot WanalertlakPaphun

WangmutitakulTeerawat Wuttiwat

Page 44: Automatic Generation of  Web-Based GIS/Database Applications

URL

http://yukon.een.orst.edu/