ABSTRACT
There is growing needs for web based GIS for easy and fast dissemination, sharing, displaying and processing of spatial
information which in turns helping in decision making for various natural resources based applications. In order to
make a cost effective implementation, operation and maintenance of spatial information over the web, a cheaper yet
feature rich alternative to commercial software is required which can be fulfilled by Open Source GIS software. This
paper conveys an efficient approach to customize and integrate an open source web GIS system based on Mapserver as
a web GIS server and PostgreSQL/PostGIS as an object oriented relational database management system (ORDBMS)
for effective dissemination, sharing and management of spatial information over the internet. An open source web application tool built on top of MapScript using the PHP programming language has been used as for development of interactive user interface. The configurable Web Mapping Client Components (CWC2) tags have been added to HTML
template pages in order to deploy the mapping contents to a web application. It is observed that the present system developed using open source software enables user to view, update, customized retrieval, query and analysis of natural
resources information for specific needs.
Keywords: GIS; Mapserver; ORDBMS; CWC2; HTML
1. Introduction
Geographical data services via internet require proper
management of spatial and non-spatial data. Geographic
Information System helps in effective analysis and management of spatial data. Spatial data attributes can be
efficiently managed using open source [1,2] based Object
Oriented Relational Database Management System
(ORDBMS). The development of a Web-based system
by integrating GIS and ORDBMS allow the user to operate the system without having to understand with the
underlying intricacies of GIS and ORDBMS technologies. Moreover, it would allow sharing of spatial information and technical expertise among varied users. The
following sections describes various steps and methodologies of WebGIS development as part of potential sites
mapping for sericulture development in Champhai
district of Mizoram, India. It is developed by integrating
the Minnesota Mapserver [3] (UMN), PHP, Apache Web
Server, Chameleon, PostGIS [4] and PostgreSQL [5]
Object-Relational data-base by adopting a Web based
client/server environment. The system described here
aims at providing a web-based platform for collaboration
and data sharing between specialists, planning agencies,
Copyright 2012 SciRes.
citizens, and private entities. To access the spatial database by the user, a Web browser and access to the Internet only is needed.
262
P. S. SINGH ET AL.
to the web have been used as spatial data server. It creates map images from spatial information stored in digital format. It can handle both vector and raster data.
MapServer can render over 20 different vector data formats, including shapefiles, PostGIS and ArcSDE geometries, OPeNDAP, Arc/Info coverage files.
MapServer is template based. When first executed in
response to a web request, it reads a configuration file
(called the map file) that describes the layers and other
components of the map. It then draws and saves the map.
Next, it reads one or more HTML template files that are
identified in the map file. Each template consists of conventional HTML markup tags and special MapServer
substitution strings. These strings are used, for example,
to specify the paths to the map image that MapServer has
created, to identify which layers are to be rendered, and
to specify zoom level and direction. MapServer substitutes current values for these strings and then sends the
data stream to the web server, which then forwards it to
the browser. When a requester changes any form elements on the page (by changing zoom direction or zoom
value, for example) and clicks the submit button, MapServer receives a request from the web server with these
new values. Then the cycle starts again. MapServer automatically performs several tasks when generating a map.
It labels features and prevents collisions between neighbouring labels. It provides for the use of both bitmapped
and TrueType fonts. Label sizes can be fixed or configured to scale with the scale of the map. The option to
not print labels for specified map scale ranges is also provided. The Chameleon, a highly customizable and adaptable environment for deploying and managing Web mapping applications is used to design and Graphic User Interface of WebGIS.
2.1.1. The GIS Engine: Mapserver
MapServer 5.2 is an open source program created by
University of Minnesota. It is the GIS engine of our
WebGIS project: it acquires and processes requests
coming from the user and returns him output results.
MapServer consists of three different components: map
file, template files and the CGI program. The map file
needs to set cartographic parameters, cartographic objects, data loading, classification, displaying and querying and graphic elements definition and use. It is implemented using MapServer softwares built-in object oriented scripting language with which it is possible to design how to create and use the maps and their layers. In
particular, in the map file Layer Objects the paths and
connection types to data load are specified: there is a
direct connection for shapefiles and raster files while
more complex connections are necessary for other data
file formats; among them, OGR connection (by OGR
library) and PostGIS connection (by PostGIS program)
Copyright 2012 SciRes.
are used for ESRI vector file and PostgreSQL tables. The
template file is a common HTML page provided with
MapServer specific parameters and variables. The template files are the files the user see by his browser, so
they are implemented to present maps, cartographic objects, query and all other information which the web GIS
designer want to offer to the user. The CGI program is
the real engine of the web GIS: started up by the web
server, it reads and processes both the map file settings
and the template file user defined parameters or variables
and returns the processed outputs as maps, cartographic
objects, variables values and query results shown in the
template files. Every CGI output is a temporary image or
value updated at each CGI work session.
2.1.2. Interaction of MapServer with PostgreSQL
The original ESRI shapefiles were converted into All the
spatial data are stored as PostgreSQL tables; in this way
PostgreSQL becomes an indispensable system component from which the web GIS loads data to be displayed
in the maps; these tables are called by MapServer using
the map file PostGIS connection (Figure 1). Each PostgreSQL table has been previously provided with a Geometry Column, in which every record has its spatial
description. In this way the tables become spatial tables. The Geometry Column provided spatial information has been done by PostGIS: using the special AddGeometry Column function for the spatial layer table
and automatically with PostGIS Data Loader for paths
and highlights tables. So, for loading spatial tables it is
enough to specify in a map file Layer Object: 1) the
PostGIS connection type; 2) the connection parameters,
in particular the name of the database containing the spatial table to be loaded; 3) name of the spatial table and its
Web server
Map File
CGI
PostGIS
Template file
(HTML)
Data
PostgreSQL
Browser
CONNECTIONTYPE postgis
CONNECTION dbname = postgis host = localhost
port = 5432 user = postgres password = puyam
DATA the_geom from mulberryvill USING UNIQUE gid USING SRID =
-1
JGIS
P. S. SINGH ET AL.
263
264
P. S. SINGH ET AL.
tion tools: zoom in, zoom out, zoom to full extent, selective zoom, re-center tool, pan, distance measuring and
print map tools. Featues on the map can be identify using
Map Identify tool. Distance measuring tool of map also
have been included as part of spatial map analysis tool.
Results of map query or area of interest can be printed
out along with detail legend using Print tool. The size,
font type and map output can be customize using this
tool. The map can be produce in various file formats such
as PNG, JPEG, GIF or PDF. Region specific zoom is
made possible using QuickZoom tool.
Searching of non-spatial attributes could also be performed by the users. To do this, user first selects a layer
and then a filed from its listed fields/columns. An attribute to be search is entered in the textbox. Clicking the
Search by Value will create a pop-up window listing
the attribute table matching the search criteria and subsequent zooming in the map and highlighted. Figures
3(b), (c) show the widget to perform this.
The automatic identification of map on mouse cursor
moves is made possible using Auto Identify widget.
The user selects a layer and its corresponding attribute(s),
once applied; the user sees the attributes corresponding
to the map location when mouse cursor moves. Figure
3(d) depicts this tool.
The addition of WMS [13] layers is also possible on
this WebGIS [14] portal. First we host the layers having
similar projection through the Geoserver. The Figures
3(e), (f) show this tool.
P. S. SINGH ET AL.
265
(a)
(b)
(f)
resources. This way, if the map zoom in widget was implemented correctly on the local server, in theory all that
would be required was to transfer the widget files over to
the live local server. The Chameleon 2.5 web mapping
software was installed on a local server. The framework
was then integrated into the local server.
(d)
REFERENCES
(e)
[1]
X. F. Song, Y. Kono and M. Shibayama, The Development of Web Mapping Application Using Open Source
GIS Solution, International Symposium on Geoinformatics for Spatial Infrastructure Development in Earth
and Allied Sciences, 2004.
[2]
P. S. SINGH ET AL.
266
and XML Technologies, a Close Relationship, 7th AGILE International Conference on Geographic Information
Science, Greece, 2004.
[3]
Mapserver. http://mapserver.org/
[4]
PostGIS. http://postgis.refractions.net/
[5]
PostgreSQL. www.postgresql.org/
[6]
[7]
[8]
[9]
JGIS