Home Articles Design and implementation of a web-based GIS for the Iranian Roads Information

Design and implementation of a web-based GIS for the Iranian Roads Information

Saeid Mohsen Kalantari Soltanieh
M.Sc. Student, Dept. of Geodesy and Geomatics Eng.
K.N. Toosi University of Technology Vali_asr St, Tehran, Iran, P.C. 19697
Tel: +98 21 8789357, Fax: +98 21 877 9476
Email: [email protected]

Ali A. Alesheikh
Assistant Professor, Dept. of Geodesy and Geomatics Eng.
K.N. Toosi University of Technology Vali_asr St, Tehran, Iran, P.C. 19697
Tel: +98 21 877 0006, Fax: +98 21 877 9476
Email: [email protected]

Hossein Mohammadi
M.Sc. Student, Dept. of Geodesy and Geomatics Eng.
K.N. Toosi University of Technology Vali_asr St, Tehran, Iran, P.C. 19697
Tel: +98 21 8786218, Fax: +98 21 877 9476
Email: [email protected]

The Internet is a global, public collection of individual networks run jointly by private organizations, universities, and government agencies. (Intranets are private networks that use Internet technology.) The Internet can be viewed as a physical network, which interacts with computers, software, and data on different levels, or tiers. For the purpose of this project tree tiers of Internet interaction are defined as client, middleware, and server. It’ll be discussed where IMS components fit within this framework.

Dynamic link libraries
Libraries store commonly used procedures. As project executes, it can call procedures from libraries. This technique is especially useful for procedures used by multiple projects; only one copy of the libraries is kept in memory and its procedure can be called by more than one project. Widows use dynamic link library (DLL) to store collection of procedures. The DLL file is the linked to your project when it runs. DLL files have extension of DLL. Windows application routinely uses DLLs. A project can call a function from the libraries and pass arguments if needed. The function is maintained separately from the programs that call it.

Therefore changes are made to the internal workings of a function in a dynamic link libraries without having to recode the entire project.

Most of the windows DLLs code in the C language and require some use of C syntax. Don’t worry if you don’t Know C. You only have to pass arguments to the library procedures. Kntudll is the in-process, dynamic link library (. DLL) component that extends your Web server software so that it can manage requests and responses from the map server and administer map services. It manages connections with map services running on one or more map servers.

GIS in the web
Maybe you have seen numerous web-based mapping, in addition to the map display it is needed to support zoom, pan, identify and measuring as basic function of GIS. For application development it’s needed to use additional and maybe complex functions.

Many web sites support various GIS functions and each of them probably has different design strategy.

Web GIS application involve a user, client, who contacts a server for some information. Commonly two strategies have been used for web GIS applications.

The first extreme is for the server to pass data and mapping application to the client. That is the server supplies the data and the programs, but all GIS functions are carried out on the client side (client side strategy).

The second strategy is to have the client indicate the type of map of functions that wishes to run and for the server to pass back the map the client request.

Several factors influence the strategy of web GIS. Ease of the use, amount of data, function, attributes, disk space, RAM, site receiving traffic are factors that web GIS strategy is relevant to them.

Next section debate about needs of TTO Web GIS for offering a suitable strategy.

Need analysis and Methodology
The object of the TTO project is to disseminate Iranian road Information through the Internet so that constituent can easily access the data. The requirement analysis step has been performed through interviewing potential users. This steps produced two critical pieces of information:

  • A list of functions that is needed. The required functions are the basic visualization function such as Pan, Zoom, and more advanced function such as object identification, attribute query, shortest path, location map, clear selection, moving the view, download and measuring. Client can use these functions to view road information, and peripheral constructs such as gas station and rest area.
  • A master list of available/needed geographic data. TTO has captured several layers of road information using GPS. In this project, Only 25 layers of Information have been used that includes police station, restaurants, gas station, mosque, etc.

Once the required data has been identified, the data model that identifies the entities and their relationship were designed. Since, the data will be delivered through a central server and clients will access to raster formats, client side strategy was chosen providing the users access to interactive map.

Selecting suitable software is an important step in a successful implementation. Software was evaluated on functionality and performance, and independent of the hardware and operating system. Web GIS requires specific hardware configuration. Since the volume of transferred data is huge, the speed of Internet connection is vitally important. Most of the data are sent from map server to clients, as such the Send speed has been identified to be more than 128kbs. Based on a pilot project and the experienced gained through similar projects, a Dual Processor computer with 512 MB Ram has been selected for this project.

The initial Requirement Analysis contained some applications of a complex nature. However, the majority of initial applications was straightforward, and can be implemented using the basic functionality that is part of the Web GIS software (e.g., display). The more complex applications were not supported by the basic functions of Web GIS but have been programmed. Ease of use, user-friendliness, and reducing the volume of data transfer were the critical issues considered in the development. https://www.iranroads.com shows the user interface that has been programmed using HTML, Visual Basic and Java Script.

Before it can be implemented the strategy it must be first understand how web pages work.

Data entering via web page
Web pages are based on special language known as Hypertext Transfer Language or HTML.HTML is a language that web browsers such as Internet explorer can understand. It’s fairly easy language to understand although advance web pages can be quite complex.

In this section, input devices for client such as checkbox, selection list, radio bottom, text box, image bottom, submit bottom and hidden inputs are explored.

  • Checkbox: It is used for selecting the available layer of data in the map for making them visible or invisible on the map.
  • Radio bottom: Commonly the active layer of data in GIS is single. for activating the layers for running function like identify radio bottom is used.
  • Selection list: This input device used for building query from existing items in database. Also in shortest path function the selection of start and destination cities is done via selection list.
  • Image and submit bottom: Image and submit bottoms is the most useful input device in user interface web GIS site. For running all of the functions this input device is used.
  • Textbox: It’s used only for entering the downloading process password.
  • Hidden Inputs: This inputting method that is input the user does not see, but server will see. For example in order to pass a hidden input (map extent) based on user input from previous page require that second page be constructed after the user has selected the variable to be passed.

Each input is sent to the server paired with its value. In addition of using HTML primary input object, Java script technology is used for managing these object property and events. For example by using this technology the legend opening and closing is managed.

Figure 1: Web-GIS User Interface

Receiving Client side request
In order to build a custom map server application, it is important to understand the client/server transaction process. The following steps outline what happens when a client on the Internet makes a URL request to a server that hosts Kntudll.dll.

A client sends a URL over the Internet to IMS Web server. The IP (Internet Protocol) address or the domain name is used to locate the server. https://www.iranroads.com/scripts/Kntudll.dll?name=IranEng&cmd=Map&left=-180&right=180&top=90&bottom=-90&mahdoodeh=ON&city=OFF

The Web server receives the URL and passes it on to Kntudll.dll. “Scripts” is an alias on the Web server that points to the location of Kntudll.dll.

Kntudll.dll determines which map service to communicate with to answer the request. Each argument and value pair is referred to as a query parameter. The first query parameter in the URL is used to determine which application the client wants to communicate with. The application name immediately follows the”?”. https://www.iranroads.com/scripts/Kntudll.dll?name=IranEng

Kntudll.dll then parses the remainder of the URL and passes the arguments and values to the map server application. The parsing occurs between each “&”. https://www.iranroads.com/scripts/Kntudll.dll?name=IranEng&cmd=Map&left=-180&right=180&top=90&bottom=-90&gasstation=ON&city=OFF

In the above example, the client is requesting a map (cmd =Map) with the extent defined by the left, right, top and bottom parameters and also the layers (City, gas station) that prefer to be visible.

Figure 2: Client request for shortest path
Handle Incoming Requests
In this step, a procedure is created to handle incoming requests from Kntudll.dll. Assume, the application is set up to handle URLs for a full extent map such as this one:

In this step, code added to handle an incoming URL with map extent parameters. Consider the following URL.

Once the procedure receives these parameters, two Strings collection objects are created. To retrieve values from the collections, the special function is used. Each value is then used to define the parameter of a rectangle that will be used to set the extent of the map control. Once the extent of the map control has been set, the correct image can be sent back to the client.

Once the parameters are extracted and a rectangle is created, the value of the “cmd” argument needs to be determined. If the value is “Map”, map creator function calls HTML creator to return a new map to the client. If “cmd=Map”, but the extent parameters are not provided, a full extent map is returned. If the Left, Right, Top and Bottom values are provided, a new map at that specified extent is created. If “cmd” equals other value, other procedure is called.

Responding the client request
The code is in place to handle the request, extract the map extent, and create the rectangle that defines the extent of the map control. Now the HTML creator procedure needs to be created to send the appropriate HTML document to the client. In order to do this, a rectangle argument needs to be added to the HTML creator procedure. The rectangle value is then passed to map creating method to set the map extent and export the appropriate image. HTML creator then sends back an HTML document with an image reference to the requesting client. Embedded in the HTML document is a FORM tag. This tag is used in the next section to handle input from the image form element. WriteString() is used to send HTML strings line by line to the browser.

The map creating method generates the appropriate image and returns an image reference tag for the HTML document. Each time map creating method is called, a counter form level variable is incremented and used to create a unique image name, unique image names prevent existing images from being overwritten and ensure that each client receives a new map from the server for every transaction. Once the image is generated, a location must be defined where the images can be stored. This location must be accessible for clients via the Internet, which usually means it is outside the firewall. The location where the images are written as c:inetpubwwwroottemp. The images are initially created in BMP format and then converted to JPEG. This code is set up to delete the BMP with the kill method in VB. The JPEG images after a period will be deleted.

Figure 3: Web-GIS User Interface after shotest path function

Figure 4: shortest path result report
Adding new functionality
To enable some functionality like zoom, pan, identify, measuring on the server side, a client must send three pieces of information to the server.

  • A request in the URL indicating the requested operation is required
  • The current extent of the image
  • The location point of the mouse-down event on the image

With this information, the server can set the current map extent, convert the mouse-down point from image units to map units, perform the requested operation, and return the correct values or image to the client.

Otherwise some functionality like query builder, shortest path, media, changing the view and clear selection need:

  • A request in the URL indicating the requested operation is required
  • Values that selected from list boxes

Each time the procedures execute, variables must be reset. If the variables are not reset for each transaction, values for example continue to draw for every request there after, or until again same request is made.

It’s important to indicate that if the functionality increased managing the receiving request become difficult. Some parameters are not needed in procedures so it must be deleted from incoming URL. On the time that new request is sending to the server additional parameter eliminate using JavaScript syntaxes.

Another out standing point is that it must not be allowed on client request make a mistake in another client request. For overcoming this problem programming architecture is suitable and variables set in correct position.

Conclusion and Recommendation
This pare presented a method of serving map on the web that used script for passing values from the client to sever side and the client will see only the result of the request. The program that was created can run as an interactive program. Most of GIS common functions and special TTO functions are implemented.

The important note is the effect of one client request on the other client result. The managing of this problem is important and difficult specially in database processing oriented functions.

Agent oriented managing has emerged as primary research in computer science and can be used to increase effectiveness of users in complex application domain like distributed GIServices and web-GIS. For feature work we proposed GIService consist of a federation of intelligent agents that cooperatively work together in supporting the problem solving activity of the user. They help the user in modeling, processing, analyzing, and solving the specific need at hand.


  • Kalantari SM (2002), Developing web GIS solutions with componentware technology M.Sc seminar
  • Alesheikh AA & Helali H (2001), Distributing National Geospatial information
  • Proceedings of Digital Earth 2001, Fredericton, NB, Canada
  • Julia Case Bradley, Anita C.Millspaugh, Programming in Visual Basic 6.0, McGRAW-HILL press.