Kanjana Chuenpichai, Sutisak Chuenpichai and Ard Somrang

Paper No: 755

GIS and Expert System Integration for Land Development Village, Thailand

Abstract:

This paper represents the integration of GIS and expert system through DDE creating a tool with more general usability. Then it applied to the upland areas in Chiangmai aims to design soil and water conservation system and soil lose evaluation at pre- and post project including cost estimation for decision making. Land development village is established to integrate land development activities to provide farmers to use their land sustainably. The utility of integrated GIS/expert system, especially its use for supporting land development village planning, is displayed and discussed. With special attention to user interfacing, and the results demonstrated


I. Introduction

Development without conservation concerns has caused the overuse of land resources. Ineffective management and implementation of systematic land use planning have accelerated their deterioration and depletion to a serious degree. Such problems, if no remedial actions are undertaken, will become a major impediment of socioeconomic development in the near future. Therefore, land resources management and planning is necessary to bring about sustainable development.

Solutions for land development in the land development village and regional planning problems, however, frequently require not only spatial analysis but also heuristic analysis, which commonly depends on the planners' instinctive judgement. GIS techniques, which mostly deal with spatial and numerical analyses of data, do not have the capability of incorporating heuristic knowledge of planners into problem solving. Expert systems, on the other hand, do permit the use of heuristic knowledge of human experts through computer applications and thus may provide a more effective way to support coastal land evaluation and planning tasks.

The purpose of this study is to integrate geographic information systems (GIS) with expert systems to develop a technical method and tool for sustainable land development, based on the physical productivity of the soil. The main objectives for the GIS/Expert System development is to apply this integrated system to the land development village planning and development.

II. The Proposed Interfacing Approachss

Loosely-coupled approach maintains the separate identity of the two systems which regard the external DBMS and the logic programming language as communicating through an interface. The interaction comprises the expert system formulating a query and the DBMS compiling and optimizing the query, retrieving the data, and passing it to the expert system. The critical issue is an efficient technique of formulating the queries to minimize the traffic of data and the number of DBMS calls (Kerschberg, 1988).

III. Architecture of GIS and Expert System Integration

Combinations and configurations of linkage operations provide basic capabilities for integrating the system. Loosely coupled approach is selected for this study for the following reasons:
   - The expert system, using Knowledge Pro as an expert system shell, is run on the Windows operating system and can support the use of Dynamic Data Exchange (DDE).
   - The GIS, using ARC/INFO and ArcView, is also run on the Windows operating system and provides ArcView scripts which are macros written in Avenue, ArcView's programming language and development environment, to support DDE and Open Data Base Connectivity (ODBC) (Wilken and Honekamp, 1991).
   - The DDE function is used to initiate a DDE conversation with another application, with the specified application and topic, and requests the data in item, and display that information in a control on a form or report. DDE also allows KnowledgePro to act as the server in DDE conversations. A server responds to DDE requests initiated by other applications. Using DDE both another window application can be controlled from KnowledgePro and KnowledgePro can be controlled from another application. KnowledgePro is the client when it initiates a conversation with and requests information from another application, ArcView. When another application, ArcView, initiates a conversation with and requests information from it, KnowledgePro is the server. The application acting as the server is passive and responds to the client.
    - ODBC (Open Data Base Connectivity) is a widely accepted application programming interface (API) for database access. ODBC technology provides a common interface for accessing heterogeneous Structured Query Language (SQL) databases. ODBC is based on SQL as a standard for accessing data. This interface provides maximum interoperability: a single application can access different SQL Database Management Systems (DBMS) through a common set of code. This enables a developer to build and distribute a client/server application without targeting a specific DBMS. Database drivers are then added to link the application to the user's choice of DBMS. ODBC Applications are not tied to a proprietary vendor API. Therefore, a wide variety of database management systems (DBMSs) can be accessed with the same ODBC source code that is directly incorporated into an application's source code.


With loosely coupled approach, the interfacing system can be divided into (a) the interface between GIS and expert system; and (b) the interface of GIS and data based system.

III.a The Interface of GIS and Expert System (Figure1a.)

GIS and expert system are interfaced through DDE on the Windows operating system. At this interface stage, the expert system will send the SQL command to the GIS and the GIS will return information stored in string commands to the expert system to be considered and the expert system will decide the requested user's solution. The command used in this step is similar to the SQL (Nyssen and Falkenberg, 1984).

Windows operating system allows loaded programs to communicate with each other using a protocol called DDE. To begin a DDE with another application, a DDE channel must be first initialized through which communication will take place. Before a channel can be initiated, that application must be loaded. This can be done under KnowledgePro control using load_program as shown in Box 1. When a DDE channel is open, a channel handle is returned. This handle is used in any request made to the server. Here, the channel handle is assigned to the topic channel. The first parameter of dde_open, ddedata, is the name of the topic which is passed the information from all DDE requests that use this channel. The next parameter is the name of the application to be a server, ArcView. The last parameter, system, is the name of the subject of the conversation. Once a DDE channel is opened, one can request data from the server, monitor the status of a data item in the server, write data to the server and execute commands in the server. After a channel is initialized data can be requested from the server, using dde_request with the format:

dde_request (DDE_HANDLE, ITEM, FORMAT).

In Box 1, ?channel is the channel opened with dde_open. 'av.run' is the name of the object requested from the server and "startup" describes how the data returned to KnowledgePro. The channel is close, dde_close, when a DDE channel is no longer needed.

Box 1 Loading an external application from KnowledgePro

ArcviewTask is load_program ('C:\Esri\AV_GIS30\ARCVIEW\BIN32\arcview.exe C:\Esri\RESEARCH\reasearch.apr',3)
Channel is dde_open(ddedata,ARCVIEW,system).
dde_request(?channel, 'av.run("startup","")').
dde_close(?channel).


KnowledgePro supporting DDE is enabled to act as a server by default. Because the server is passive task, it is up to the client application to open and keep track of DDE conversation. This usually done with an initialize command which opens a channel between the two applications. In KnowledgePro this is done with the function dde_open.

Box 2 Initializing a DDE conversation with a sever.

channel is dde_open(ddedata,ARCVIEW,system)
dde_request(?channel,'av.run("what to do","")')
dde_close(?channel).


Dde_open lets KnowledgePro act as a client to ArcView (GIS part). This means it can read and write data and execute commands in ArcView, another window DDE application. Dde-open attempts to initiate a DDE conversation with a specified application, ArcView. ArcView acts as the server and KnowledgePro acts as a client in the conversation. The result Box 2 is to display all maps to be selected according to the question "What are you going to do on your specified location or address (Figure 2). A call to dde_open must be made before any of the following functions can be called: dde_advise, dde_close, dde_execute, dde_write, dde_request and dde_unadvise. When a dde channel is no longer needed, dde_close must be used to close the channel.


After a channel is initialized, data can be requested from the server, ArcView, and returned to the client, KnowledgePro, by the default format, text. If the request succeeds, ddeData is called as ddeData (Information, dde_data_event, DDEHANDLE) (Box 3) where info is a list of the data requested, the name of the information requested and the format of the data.

Box 3 Requesting data from one application and returning to another.
            Topic readselect(Query).
            channel is dde_open(ddedata,ARCVIEW,system).
            Avrun = concat('av.run("sql",{"',? Query,"'})').
            dde_request (?channel,?av.run)
            wait([],1).
            dde_close(?channel).
                      topic ddedata(info,event,handle).
                      do(?event).
                                 topic dde_data_event.
                                 readselect = first(?info).
                                 end
                      end
             end



III.b The Interface of GIS and Data Based System (Figure 1b)

GIS and DBMS are interfaced through ODBC. A SQLCon establishes a connection to an SQL database (Box 4). The commands received from the expert system are transformed to SQL, sent through ODBC, and after that GIS will exchange commands/information to text form for sending to the expert system through DDE.

Box 4 Setting up a database connection with ODBC, how to connect to
            dBASE from ArcView using Avenue.

TheSQL=SQLCon.Find("dBASE Files")


Script is an object oriented language named Avenue. An Avenue script can be used to control how and when requests get sent to ArcView objects. Through Avenue ArcView's look and functionality can be customized. Avenue can be used to send requests to objects of pre-defined classes. However, at this release, new classes within Avenue cannot be defined.

Box 5 KnowledgePro, SQL, command being transformed to SQL
            S1 = SELF.get (0).substitute ("[",""')
            S2 = s1.substitute ("[",""')
            Astring=s2


Using ArcView's SQL connection feature, a database server can be connected and run an SQL query to retrieve records from it. The records accessed become a table that can be used like any other ArcView table. Before querying the data, SQL from KnowledgePro has to be converted to the right SQL as shown in Box 5. Using Windows, SQL connections are based on Microsoft's ODBC standard. Therefore, ODBC SQL is used when communicating with an SQL database on Windows.

IV. The Prototype of the Integrated GIS and Expert System and Its Functions

The prototype is developed to integrate GIS and expert system for providing decision making on land evaluation by suggesting the physical suitability for the specified location and activity. The prototype (Figure 3) consists of three main components as follows:
     - Spatial and attribute database based on GIS software (Arc/Info) to generate and analyze spatial data as required in this study are stored in ArcView;
     - Knowledge base system is developed in the KnowledgePro Windows Expert System shell and stored as rules and facts in the expert system part; and
     - A graphic user interface (GUI) is developed to facilitate the interface between GIS, Expert System, the display results, either maps or text, and the user

The functions of the system is to allow a user to select area of interest from a district, or sub-district to perform a suitability analysis for shrimp farming development and to indicate the suitability classes. Another option is to allow the user to select a specific use of land, the system will evaluate and classify the level of suitability classes of the selected land use.


IV.a GIS: Spatial Database System

Figure 4. Spatial data developed in this study and the structure of the soil database



A spatial database in this study is designed to store and manage soil data at the series level. The spatial data are initially generated and stored as coverage, based on ARC/INFO. The feature attribute tables are linked to the relational tables which store data for each horizon of all soil pedons found in the study area, Chanthaburi. A structure of soil database is also shown in Figure 4. It is flexible to allow the user to make a query on the specific soil characteristics and it can be transformed and exported as soil input data for the decision making process in the integrated system.

IV.b Expert System: Knowledge-Based System

As mentioned earlier, the knowledge based system comprises a set of rules and facts about the problem domain and the inference engine mechanism to infer the conclusions after examining the knowledge base.

The main purpose of this study is to develop the expert system with the integration to GIS for coastal land use planning and management in a PC-based environment. Therefore, the objectives of the expert system development is to develop a knowledge-based system in order to select the area suitable for either "crop competitive zones" or "agricultural self sufficient zones"

Once KnowledgePro is decided as a tool for use for this study, the time of consultation period are implicitly considered for the appropriate problem to this paradigm. However, the following issues have to be considered in order to develop the knowledge-based (expert) system for coastal land use planning.
     - the expert system must be able to support decision with an accent on 'land
evaluation for crop competitive zone.
     - the expert system must have a user friendly interface where the user retains control over the decision process,
     - it should provide an interactive mode to obtain external information by calling,
     - it can utilize an appropriate mathematical model,
     - it can store the user information for system verification,
     - it can be interfaced to the GIS application,
     - the recommendation can be inferred through menu driven interface,
     - the expert system can be edited and more objects and rules added subsequently according to the knowledge engineer,
     - the database system must be included,
     - the conclusion or recommendation inferred by the expert system can be distributed to the user for making decisions.

In summary, since the knowledge base is built through the use of rules, the inference engine allows the expert system to make conclusions based on the 'expertise' or 'knowledge' stored in the knowledge base. The inference engine provided by KnowledgePro is called "backward chaining" (goal driven). The inference engine starts by identifying the goal variable and then moves through a sequence of rules until it finds a value that can be assigned to the goal variable.

A prototype of knowledge-based system can be developed by converting the information into a rule based form. The formal knowledge form then are transformed into the functional KnowledgePro form.

IV.c User Interface to the Integrated GIS ~ Expert System

The prototype is executed through a highly interactive geographic interface. When an application is built, one of the most important considerations is how the user can communicate with the application. KnowledgePro for Windows has many different screen objects, which can be collected and grouped to perform the user interface. Each object has different characteristics and is used to convey different type of information. With KnowledgePro, any of the objects provided by the Microsoft Windows interface can be created by merely by calling a function. Nevertheless, KnowledgePro has the standard screen objects, eg. windows, buttons etc; texts and graphic objects, including bitmaps, icons and cursors. This study also uses Avenue script of a customized ArcView GIS to enable use of spatial features, maps, in the display functions.

Interfaces are used to transfer data from one component to another. An explanation of function of each interface is best illustrated by simulating the use of the system. This study system employs a graphic user interface (GUI) that is designed to link the spatial database with the knowledge base of the expert system in order to facilitate the selection of area suitable for a specific land use, management strategies and various scenarios of the coastal land use planning.


V. Implementation for the Integrated GIS / Expert System and Benefits

The crucial question is "What information gives the decision maker enough support to make acceptable, responsible decisions, at least in the decision maker's opinion, on land use planning?" In this study, probably the decision-maker may want to know the locations that are more suitable for the specified crop/activity or want to know what is the best use of land on a specified location. However, that is still a general question. What do they want to know more in particular ?

The implementation of the system prototype consists of integration of two main programs, the integrated expert system, KnowledgePro, and the GIS program, ArcView on Windows. These programs are written in the KnowledgePro language of KnowledgePro Windows, the Avenue script of ArcView and SML of Arc/Info. The GIS/ExpertSystem prototype is implemented by writing several linking programs, because the use of more than one programming language, modular programming design makes the programming and debugging process less complicated, and because a large single program cannot be executed within the KnowledgePro Environment. Data can be transferred from the expert system to be elaborated in the GIS, transferred back to the expert system for suitability analysis, and finally sent to GIS for mapping and plotting.

In the field of land use planning related to natural resources management, specially soil, the use of information technology and knowledge based system can promise benefits as follows:
# The GIS/Expert system offers an access to isolated officers and facilitates the mobilization of experts and information in distance planning.
# It can liberate expertise from geographical constraints, making expertise deliverable almost everywhere.
# Transferring new technology from the research to practical application can be made through GIS and expert system integration.
# More knowledge can be incorporated into the GIS/Expert system, so that it can easily be implemented, modified, verified and improved.


VI. Conclusion

The Integrated GIS & Expert System seems to be a sound tool in database and knowledge based management system for offering the basis for solutions of the use of land resources. It is powerful, flexible and suitable. Different options for specific purposes of land development and management need to be made explicitly based on various rationales through criteria specified by the planner and people's needs. Since decision makers or planners are not experts in each relevant professional field, access to the knowledge, experience and judgement of other experts is necessary.

The use of expert systems offers great potential for making critical experts' knowledge more readily accessible to local officers when they are needed. A possible solution to this is an integration of GIS and expert system approaches specially designed to represent spatial resource databases and human expertise to find alternative solutions for sustainable use of lands while the user consults the integrated system.

This integrated system can be applied to be used by the 12 Regional Land Development Offices and 69 Land Development Stations around the country, under the Land Development Department. It has made site data come alive and work for the local officers which continues to expand to the farmers.

VII. References

Avenue, (1994). User's manual. ArcView, Esri: Environmental Systems Research Institute. Redlands, California, USA.
Chuenpichai, Kanjana (2001). Integration of Geographic Information System and Expert System for Coastal land Use Planning in southeast Thailand: Chanthaburi Province. Ph.D. Thasis, Asian Institute of Technology, Thailand.
Environmental Systems Research Institute (Esri) (1987). ARC\INFO user guide, vol. 1: Geographic information system software. Redlands, CA, USA.
Environmental Systems Research Institute (Esri) (1991). Information material for the ARC\INFO system. Redlands, CA, USA.
Environmental Systems Research Institute (Esri) (1994). ArcView. Redlands, California, USA.
Kerschberg, Larry. (1988). Expert Database System. The Benjamin/cummings, California.
Knowledge Garden, (1991). KnowledgePro Windows: User Manual, New York, USA.
Nijssen,G.M. and Falkenberg,E. (1984). CS112: Introduction to IBM SQL Release 2, Queensland Information Technology Pty. Ltd.
Wilken and Honekamp, (1991)."Windows System Programming", Abacus, Germany.


Author Information:

Ard Somrang
CIO, Land Development Department
Chatuchak, Bangkok 10900. THAILAND.
Tel. 66 02 5611954, Fax 66 02 5620313
ardsr@ldd.go.th

Kanjana Chuenpichai, Ph.D.
Land use Planning Section
Land development Office Region 6
Chotana Rd., DonKaew
MaeRim, ChiangMai 50180. THAILAND.
Tel. 66 053 222744, Fax 66 053 216219
kanjanac@ldd.go.th
kanjana2499@hotmail.com

Sutisak Chuenpichai
Socio-Economist
Land use Planning Section
Land development Office Region 6
Chotana Rd., DonKaew
MaeRim, ChiangMai 50180. THAILAND.
Tel. 66 053 222694, Fax 66 053 216219
r06_1@ldd.go.th