Automatic Generation of Web-Based GIS/Database Applications

Post on 21-Jan-2016

22 views 0 download

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 minoura@eecs.orst.edu. Outline. Web-based GIS/database applications WebGD Framework - PowerPoint PPT Presentation

transcript

Automatic Generation of Web-Based GIS/Database

Applications

Nirut ChalainanontJunya Sano

Toshimi Minoura Department of Computer Science

Oregon State UniversityCorvallis, 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.

Natural Heritage Information System

Searching in a Selected Area

Getting Information

Inserting a New Motel

Treeview

PDF File Generation

Uploading Photo Images

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

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;

Dynamic Switching of Spatial References

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

World in Longitude/Latitude

North America in Albers Equal Area

Continental United States in Albers Equal Area

Oregon in Lambert Conformal Conic

Corvallis in 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 1 selected

Region 2 (rank 11)

Region 3(rank 12) Region 3 selected

Region 2 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

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” );

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

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

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

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

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.

Form Script Generation Process

SearchTemplate

TreeViewTemplate

ActionTemplate

InfoTemplate

EditTemplate

SelectTemplate

TreeGenConfiguration File

WebGenConfiguration File

TreeViewScript

ActionScript

InfoScript

EditScript

SelectScript

Search Script

Linked Forms

Student Edit Form

Department Edit Form

Department Search Form

Course Select Form

Selected ID

Department Select Form

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

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

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

);

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

xxx_maplayer.config

Customized xxx_maplayer.mconfig

map_confgen

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_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

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

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

Acknowledgement

Dileep ArurHaris GunadiSurya Halim

Hong Gyu HanMariko Imaeda

Junya Sano

Akash SharmaHiroshi Tashiro

Naroot WanalertlakPaphun

WangmutitakulTeerawat Wuttiwat

URL

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