You are on page 1of 10

ARTICLE IN PRESS

Computers & Geosciences 30 (2004) 637646

Implementation of the analytical hierarchy process with VBA in ArcGIS$


Oswald Marinoni*
Institute for Applied Geosciences, Georesources and Geohazards, Technische Universita Darmstadt, SchnittspahnstraX e 9, t Darmstadt D-64287, Germany Received 5 November 2002; received in revised form 20 January 2004; accepted 11 March 2004

Abstract Decisions on landuse have become progressively more difcult in the last decades. The main reasons for this development lie in the increasing population combined with an increasing demand for new land and resources and in the growing consciousness for sustainable land and resource use. The steady reduction of valuable land leads to an increase of conicts in land use decision-making processes since more interests are being affected and therefore more stakeholders with different land use interests and different valuation criteria are being involved in the decision-making process. In the course of such a decision process all identied criteria are weighted according to their relative importance. But assigning weights to the relevant criteria quickly becomes a difcult task when a greater number of criteria are being considered, especially with regard to land use decisions where decision makers expect some kind of mapped result it is therefore useful to use procedures that not only help to derive criteria weights but also accelerate the visualisation and mapping of land use assessment results. Both aspects can easily be facilitated in a GIS. This paper focuses the development of an ArcGIS VBA macro which enables the user to derive criteria weights with the analytical hierarchy process and which allows a mapping of the land use assessment results by a weighted summation of GIS raster data sets. A dynamic link library for the calculation of the eigenvalues and eigenvectors of a square matrix is provided. r 2004 Elsevier Ltd. All rights reserved.
Keywords: Analytical hierarchy process; Decision aid; Eigenvector; GIS; Land use; Multi-criteria analysis

1. Introduction A decision is a result of a comparison of one or more alternatives with respect to one ore more criteria that we consider relevant for the decision. Among these relevant criteria, we consider some as more and some as less important, a process that involves assigning weights to the criteria according to their relative importance. For
$ Code available from server at http://www.iamg.org/CGEditor/index.htm *Corresponding author. Tel.: +49-6151-16-2771; fax: +496151-16-6539. E-mail address: marinoni@geo.tu-darmstadt.de (O. Marinoni).

the majority of our every day decisions which usually have an impact only on ourselves and our immediate future, we intuitively assign weights to the relevant decision criteria. While such an intuitive approach might be defendable for ourselves, it is hard to justify when
* * *

third-party interests are affected, decisions affect medium- or long-term goals, decisions are dependent on a great number of criteria, the decision problem is too complex and expert knowledge from several science elds is needed.

To be able to manage complex decision problem constellations, risk management and decision guidelines which have a strong emphasis on risk communication

0098-3004/$ - see front matter r 2004 Elsevier Ltd. All rights reserved. doi:10.1016/j.cageo.2004.03.010

ARTICLE IN PRESS
638 O. Marinoni / Computers & Geosciences 30 (2004) 637646

and stakeholder participation have been developed and introduced in recent years (Can/Csa-Q850, 1997; As/Nzs 4360, 1999). But regardless which decision strategy is being adopted, one always comes to the point where the criteria playing a role in the decision-making process have to be ranked and weighted with respect to their relevance or importance, respectively. According to almost every modern risk management guideline, this can only be done within a communicative process. But it is easy to imagine that the determination of quantitatively hard weighting factors is hard to achieve in discussions where also non-experts have a legitimate vote. An excellent and well-known weight evaluation method is the analytical hierarchy process (AHP) proposed by Saaty (1977) whichwith regard to the development of weightshas already been called one of the most promising techniques (Eastman et al., 1998). To be able to develop criteria weights, the AHP calculates the eigenvalues and the eigenvectors of a square preference matrix which contains the quantied preference information of all possible pairwise criteria constellations. The integration of the AHP in a geographic information system (GIS) combines decision support methodology with powerful visualisation and mapping capabilities which in turn should considerably facilitate the creation of land use suitability maps. It is therefore not surprising that some popular GIS like, e.g. IDRISI (Clark Labs, 1999) have already implemented the AHP in their functionality some years ago. However, there is still no implementation of the AHP in the standard functionality of one of the most widespread GIS solutions, namely ArcGIS (ESRI Inc., 2002).

which is commonly referred to as spatial decision support system (SDSS)can be found in Carver (1991), Pereira and Duckstein (1993), Tkach and Simonovic (1997), Feick and Hall (1999), Malczewski (1999), Dai et al. (2001), and in Joerin et al. (2001). The AHP as a multi-objective multi-criteria decision making approach uses a pairwise criteria comparison to arrive at a scale of preferences among sets of alternatives (Saaty and Vargas, 1991). To apply this method, an unstructured problem must rst be decomposed in a hierarchical structure (Fig. 1). All identied criteria/factors are compared against each other in a pairwise comparison matrix which is a measure to express the relative preference among the factors. Therefore numerical values expressing a judgement of the relative importance (or preference) of one factor against another have to be assigned to each factor. Saaty (1977) and Saaty and Vargas (1991) suggested a scale for comparison consisting of values ranging from 1 to 9 which describe the intensity of importance, whereby a value of 1 expresses equal importance and a value of 9 is given to those factors having an extreme importance over another factor (Table 1). Table 2 shows a simple comparison matrix of order 3 where three criteria C1, C2 and C3 are compared against each other. In the direct comparison of criteria C1 and C3, for example, criterion C1 has been regarded strongly more important than C3, hence a value of 5 has been assigned to the corresponding matrix position. The transpose position automatically gets the reciprocal value, in this case 1/5 which equals 0.2.
Table 1 Example scale for comparisons (Saaty and Vargas, 1991)

2. The analytical hierarchy process (AHP) 2.1. Process description Multi-criteria analysis (MCA) techniques are wellknown decision support tools for dealing with complex decision constellations where technological, economical, ecological and social aspects have to be covered. To optimise land use planning, these techniques have therefore been repeatedly combined with GIS. Excellent discussions on the combined use of MCA and GIS

Intensity of importance 1 3 5 7 9 2,4,6,8 Reciprocals

Description Equal importance Moderate importance of one factor over another Strong or essential importance Very strong importance Extreme importance Intermediate values Values for inverse comparison

Fig. 1. Structured problem with three different hierarchy levels.

ARTICLE IN PRESS
O. Marinoni / Computers & Geosciences 30 (2004) 637646 Table 2 Example of a pairwise comparison matrix describing relative preferences among identied criteria Criteria C1 C2 C3 C1 1 0.25 0.2 C2 4 1 2 C3 5 0.5 1 Table 3 Values for RI (Saaty and Vargas, 1991) n RI 2 0.00 3 0.52 4 0.90 5 1.12 6 1.24 7 1.32 8 1.41 639

The consistency index CI can be directly calculated from the preference matrix with CI lmax n ; n1 2

In the next step of the process, the assigned preference values are synthesised to determine a ranking of the relevant factors in terms of numerical values which are equivalent to the weights of the factors. Therefore the eigenvalues and eigenvectors of the square preference matrix revealing important details about patterns in the data matrix are calculated. The above square matrix of order three gives three eigenvalues with which three eigenvectorseach having three vector componentscan be calculated. According to Saaty and Vargas (1991), it is sufcient to calculate only the eigenvector resulting from the largest eigenvalue since this eigenvector contains enough information to provideby its eigenvector componentsthe relative priorities of the factors being considered. A recent discussion on the meaning of the principal eigenvector can be found in Saaty (2003). Of course, the values of the pairwise comparison matrix will normally be well considered and not set arbitrarily. However, peoples feelings and preferences remain inconsistent and intransitive and may then lead to perturbations in the eigenvector calculations. Such inconsistencies might be of the form that a factor Ai being preferred over another factor Aj with Aj being preferred over a factor Ak is not preferred over Ak (Ai must be preferred over Ak in this case). For this reason Saaty (1977) additionally provided a single numerical index to check for consistency of the pairwise comparison matrix. He therefore dened a consistency ratio CR as the ratio of the consistency index CI to an average consistency index RI, thus CR CI : RI 1

where lmax is the greatest eigenvalue of preference matrix and n the order of matrix. Based on expert knowledge and experience, Saaty and Vargas (1991) recommend a revision of the preference matrix if the consistency ratio CR exceeds a value of 0.1.

3. Prioritisation of alternatives The AHP also allows a prioritisation of decision alternatives. In a land use scenario these alternatives could be represented by different locations which are separately valued in respect to the relevant criteria. Suppose we had two alternatives A1 and A2 and three identied criteria C1, C2 and C3 whose preferences against each other are already established in Table 2. The criteria weights calculated from the eigenvector of the largest eigenvalue of this criteria preference matrix are given in Table 4. In the following step, the two alternatives have to be compared with respect to the relevant criteria. The weights are again calculated from the largest eigenvectors of the comparison matrices (Table 5). The prioritisation of the available alternatives is then calculated as follows: Alternative A1 : 0:687 0:83 0:127 0:75 0:186 0:14 0:69; Alternative A2 : 0:687 0:17 0:127 0:25 0:186 0:85 0:31: Since alternative A1 gets a higher score, it should be preferred over alternative A2.

The resulting average consistency index RI, which is also called the random index by some authors (Wagner, 2002), was calculated by Saaty (1977) as the average consistency of square matrices of various orders n which he lled with random entries. Average consistency values of these matrices are given, for example, by Saaty and Vargas (1991) who provided the following Table 3. Following the illustrations of Saaty (1977) who calculated RI values up to a matrix order of 15, matrices with an order greater than 8 have an RI order of magnitude value of about 1.45.

4. Implementation of the AHP in ArcGIS 4.1. Methodological overview Before a more detailed description of the VBA macro is presented, a rough summary of the main steps of the whole land use assessment procedure will be given: 1. denition of the problem/objective (what kind of land use is planned?);

ARTICLE IN PRESS
640 O. Marinoni / Computers & Geosciences 30 (2004) 637646
*

Table 4 Criteria weights resulting from preference matrix given in Table 2 Criterion C1 C2 C3 Weight

0.687 0.127 0.186

VBA macros can take advantage of global ArcGIS variables, the coding of the management of the data layers is much easier in VBA, the possibility to create, test and debug macros in the ArcGIS Visual Basic editor are the same as in the VB development environment.

4.2. Macro-description
Table 5 Preference matrices of available alternatives A1 and A2 with respect to criteria C1, C2 and C3 A1 Criterion C1 A1 A2 Criterion C2 A1 A2 Criterion C3 A1 A2 1 0.2 A2 5 1 Weight 0.83 0.17

1 0.33

3 1

0.75 0.25

1 6

0.166 1

0.14 0.85

2. identication of stakeholders and discussion with stakeholders and experts to determine the criteria which play a role for the planned land use; 3. data collection and data preparation (digitising data, statistical analysis, conceptualisation of a database, etc.); 4. creation of raster data sets representing the regionalised criteria (interpolation, e.g. with geostatistical techniques), conversion of vector data to raster data (e.g. polygons showing the extend of geological units); 5. classication of raster data sets; 6. establishment of a preference matrix, assigning preference values to the relevant criteria; 7. determination of criteria weights by calculating eigenvalues and eigenvectors of the preference matrix; 8. calculating the result raster (suitability map) as a weighted summation of all criteria raster data sets. Please note that the program described in the following sections is relevant from point 5 on. This program has been written in Visual Basic using ArcObjects which is the development platform for ArcGIS (ESRI Inc., 2002). The program has not been developed as a separate executable le, but runs as a VBA macro in the ArcGIS environment. The main reasons not to develop a standalone application were:
*

VBA macros in ArcGIS applications can use the ArcGIS functionality to its full extent,

Supposing a specic land use scenario, the macro expects that all criteria considered relevant for that land use are regionalised in raster data sets and that these raster data sets are accessible as layers in the current ArcGIS session. Figs. 25 give a detailed overview of the macros program steps. The rst thing to do is to tell the relevant criteria to the macro (Fig. 2). However, the criteria being considered usually do not only have a different value range but also different dimensions which makes necessary a transformation bringing all criteria to a common scale. Therefore the criteria rasters have to be classied. In the reclassication process, the complete value range of a criterion is divided into several intervals (classes) for which new values have to be assigned. The new class values should describe the quality of a criterion with regard to the intended land use. If for example a low annual precipitation is considered very bad, the new values for this class should be set to zero and other or better classes should receive higher values. It is easy to let calculate a criterions class borders automatically, but there should always be a possibility to set these values manually which allows to take account of expert knowledge (Fig. 3). Important is the possibility to dene the number of classes interactively and to assign descriptors to each class which can later be used as descriptors in a map legend (Fig. 6). To guarantee that the number of classes remains the same for every reclassied criterion a mechanism which keeps the number of classes constant is implemented. The result of every reclassication is added as a new reclassied raster layer to the current ArcGIS session. After the reclassication, the preference matrix must be lled with values expressing the relative preference or importance of one criterion over another (see Section 2.1). Having entered a value, the transpose cell is automatically lled with the reciprocal value. Since the elements of the main diagonal of the matrix always remain 1 they need not to be edited (Fig. 4). However, before any values can be set, the user has to set a preference table in which the scale of comparison (see Table 1) and the preference descriptors are dened. The criteria weights are developed by calculating the eigenvalues and the eigenvector of the largest eigenvalue of the preference matrix. The weighting factors are calculated from the components of the

ARTICLE IN PRESS
O. Marinoni / Computers & Geosciences 30 (2004) 637646 641

Fig. 2. First step of described VBA macro. Specication of raster layers representing regionalised criteria.

Fig. 3. Reclassication of input raster data sets (key ArcObjects interface which is used by VBA macro is IReclassOp interface).

largest eigenvector by summing up the components and dividing each component by this sum which guarantees that the sum of the weights equals 1. Moreover, the consistency ratio is given indicating if a revision of the assigned preference values is advisable or not (see Section 2.1). It is especially the eigenvalue and the eigenvector calculation which makes the AHP fairly

complicated. The VBA macro calls an eigenvector calculation routine which has been implemented in a dynamic link library and which is made publicly available (see Section 6). Finally, all classied rasters are multiplied with their corresponding weight and summed up (Fig. 7). Each raster cell of the result raster is calculated

ARTICLE IN PRESS
642 O. Marinoni / Computers & Geosciences 30 (2004) 637646

Fig. 4. Input of preference values and calculation of weights with AHP. To perform eigenvalueeigenvector calculation, function getEigenvectors which is dened in dynamic link library EigenUtl.dll must be called.

Fig. 5. Calculation of result raster map by building weighted sum of reclassied raster data sets. Weights of AHP calculation are used. Conversion of result raster map to a vector feature is possible (key ArcObjects interfaces which are used by VBA macro are IMapAlgebraOp and IConversionOp interface).

as follows: rix; iy
n X i1

wi vi; ix; iy

with ix 1ynx; iy 1yny; 3

where rix; iy is the value of the result raster at cell (ix; iy), wi the weight of the ith criterion (with i 1yn; n=total number of criteria being considered), vi; ix; iy the classied value of the ith criterion at cell (ix; iy), nx; ny are the number of raster cells in x (nx) and y (ny) direction.

ARTICLE IN PRESS
O. Marinoni / Computers & Geosciences 30 (2004) 637646 643

Fig. 6. Program surface depicting user interface which enables user to dene class descriptors and to keep number of classes constant.

The result raster is added to the current ArcGIS session and represents a map of suitability zones with respect to a specic land use where the higher result raster values usually represent those areas which are more suitable. Please note from the descriptions of Figs. 3 and 5 that the macro uses ArcObjects interfaces which imply functionality of the ArcGIS Spatial Analyst extension. Therefore an additional ArcGIS Spatial Analyst extension license is needed. To prevent a black box mapping operation, a report le giving the information of the whole assessment process including the criteria and their data sources, the reclassication settings, the preference matrix and the results of the matrix algebra operations can be optionally created. Finally, if one prefers working with vector features instead of raster data sets, the macro performs a conversion of the result raster to a polygon vector feature.

5. Example An example is given which is to illustrate the use and the output of the described macro. The suitability of an area with respect to housing construction has

to be found out. Investigation boreholes encountered organic layers and on their top layers of sand. While the organic layers have to be completely avoided for the constructions, the sand layers are regarded a favourable building ground. Additionally, it is preferred to build on pieces of land with a low slope andto avoid (or minimise) possible ooding damagesa high elevation. Fig. 8 shows the raster data sets of these four criteria. The following reclassication values were assigned (Table 6) and passed to the macro. Table 7 shows the pairwise criteria comparison matrix (preference matrix) with the assigned preference values and the calculated weights. It can be seen that the thickness of the organic layers received a weight of 0.6081. This criterion is therefore by far the most dominant, followed by sand thickness, slope and nally elevation which received only a weight of B4%. The left part of Fig. 9 depicts the calculated result map which has a value range from 0 to 3.75. A maximum value of 3.75 states that there is no perfect location (which should have a value of 4). However, the best locations reach B93% of the possible maximum and decision makers should now nd out if 93% are acceptable or not. Also shown is the result map as a

ARTICLE IN PRESS
644 O. Marinoni / Computers & Geosciences 30 (2004) 637646

Fig. 7. Principle of weighted combination of regionalised criteria raster data sets.

Fig. 8. Raster data sets of relevant criteria: (a) thickness of organic layers, (b) thickness of sand layers, (c) elevation and (d) slope of elevation. Note darker colours denote lower values.

polygon feature. Note that the raster map which shows almost the same outlines as the polygon feature still contains non-integer values in every single raster cell,

whereas each feature of the polygon map contains just one integer value (here values 14) representing the suitability of one polygon.

ARTICLE IN PRESS
O. Marinoni / Computers & Geosciences 30 (2004) 637646 Table 6 Criteria value ranges and their assigned class values Criteria Class values 0 Slope ( ) Elevation (m) Thickness of sand layers (m) Thickness of organic layers (m)


645

1 1420 31.732.8 24

2 814 32.834.0 46

3 28 34.035.2 68

4 o2 >35.2 >8 0

>20 o31.7 o2 >0

Table 7 Preference matrix with assigned preference values and calculated weights Criteria Slope ( ) Elevation (m) Thickness of sand layers (m) Thickness of organic layers (m) Consistency ratio CR is 0.09. Slope ( ) Elevation (m) Thickness of sand layers (m) Thickness of organic layers (m) Weight 1 0.25 4 6 4 1 6 9 0.25 0.1667 1 4 0.1667 0.111 0.25 1 0.1014 0.0414 0.2485 0.6081

Fig. 9. Result raster map and converted polygon feature map.

6. Conclusions The described VBA module which implements the analytical hierarchy process is a useful tool to facilitate land use assessment. The module accesses an external dynamic link library (EigenUtl.dll) which performs the eigenvalue and eigenvector calculations of the preference matrix and returns the criteria weights. This dll, some VB example code showing how to access the dll and an ArcMap mxd-le which incorporates the macro are provided with this paper and can be downloaded from http://www.iamg.org. Together with this dynamic link library, the presented VBA macro lls an important gap in the ArcGIS functionality, since the AHP does not belong to the standard functionality of this widely used GIS.

The short description of the macro is to provide a template not only for users who are working in the eld of land use assessment but also in other elds of geosciences where regionalised criteria play a role in a decision-making process. Once the best suitable areas are determined, possible location alternatives can be chosen more precisely and a ranking of those alternatives can easily be performed with the help of the provided eigenvector calculation routine and sparse additional code. Besides the AHP, there is a great variety of alternative decision aid methods. Since modern GIS offer integrated development environments for many popular coding languages the integration of these methodological alternativeshence the creation of spatial decision support systemsis facilitated.

ARTICLE IN PRESS
646 O. Marinoni / Computers & Geosciences 30 (2004) 637646 assessment. International Journal of Geographical Information Science 15, 153174. Malczewski, J., 1999. Spatial multicriteria decision analysis. In: Thill, J.C. (Ed.), Spatial Multicriteria Decision Making and AnalysisA Geographic Information Sciences Approach. Ashgate, New York, NY, pp. 1148. Pereira, J.M.C., Duckstein, L., 1993. A multiple criteria decision-making approach to GIS-based land suitability evaluation. International Journal of Geographical Information Systems 7, 407424. Saaty, T.L., 1977. A scaling method for priorities in hierarchical structures. Journal of Mathematical Psychology 15, 231281. Saaty, T.L., 2003. Decision-making with the AHP: why is the principal eigenvector necessary. European Journal of Operational Research 145, 8591. Saaty, T.L., Vargas, L.G., 1991. Prediction, Projection and Forecasting. Kluwer Academic Publishers, Dordrecht, 251pp. Tkach, R.J., Simonovic, S.P., 1997. A new approach to multi-criteria decision making in water resources. Journal of Geographic Information and Decision Analysis 1 (1), 2544. Wagner, E.D., 2002. Public key infrastructure (PKI) and virtual private network (VPN) compared using a utility function and the analytic hierarchy process (AHP). M.Sc. Thesis, Virginia Polytechnic Institute and State University, 50pp.

References
As/Nzs 4360, 1999. Risk management. Standards Association of Australia, 12.04.1999, Stratheld NSW, 44pp. Can/Csa-Q850, 1997. Risk management: guideline for decision makersa national standard of Canada. Canadian Standards Association, Etobicoke, Ontario, 46pp. Carver, S., 1991. Integrating multi-criteria evaluation with geographical systems. International Journal of Geographical Information Systems 5 (3), 321339. Clark Labs, 1999. IDRISIGeographic Analysis and Image Processing Software, Worcester, MA. Dai, F.C., Lee, C.F., Zhang, X.H., 2001. GIS-based geoenvironmental evaluation for urban land-use planning: a case study. Engineering Geology. 61 (4), 257271. Eastman, J.R., Jiang, H., Toledano, J., 1998. Multi-criteria and multi-objective decision making for land allocation using GIS. In: Beinat, E., Nijkamp, P. (Eds.), Multicriteria Analysis for Land-Use Management. Kluwer Academic Publishers, Dordrecht, pp. 227251. ESRI Inc., 2002. ArcGIS 8.2. ESRI Inc., Redlands, CA. Feick, R.D., Hall, G.B., 1999. Consensus-building in a multiparticipant spatial decision support system. URISA Journal 11 (2), 1723. Joerin, F., Theriault, M., Musy, A., 2001. Using GIS and outranking multicriteria analysis for land-use suitability

You might also like