Jasiewicz 2011

7
A new GRASS GIS fuzzy inference system for massive data analysis Jaros"aw Jasiewicz Adam Mickiewicz University, Geoecology and Geoinformation Institute, Dzi ˛ egielowa 27 60-081 Poznan ´, Poland article info Article history: Received 11 May 2010 Received in revised form 19 August 2010 Accepted 4 September 2010 Keywords: Fuzzy logic GIS Data analysis Inference system GRASS abstract GIS systems are frequently coupled with fuzzy logic systems implemented in statistical packages. For large GIS data sets including millions or tens of millions of cells, such an approach is relatively time- consuming. For very large data sets there is also an input/output bottleneck between the GIS and external software. The aim of this paper is to present low-level implementation of Mamdani’s fuzzy inference system designed to work with massive GIS data sets, using the GRASS GIS raster data processing engine. & 2010 Elsevier Ltd. All rights reserved. 1. Introduction Many spatial phenomena show a degree of uncertainty that cannot be expressed with clear-cut boundaries. In continuous spaces where it is difficult to clearly define boundaries, terms like ‘‘close to’’, ‘‘suitable’’ and ‘‘small’’ can better express the character of divisions than a simple binary true/false classification (Burrough, 1992, 1996). Additionally, fuzzy systems are useful on areas where data are incomplete or where there are only general rules of system behaviour. Because of these qualities, fuzzy methods have been successfully applied in numerous GIS fields such as data classifica- tion (Fisher, 1999; Demicco and Klir, 2004), geomorphology and soil mapping (Burrough, 1989; Burrough et al., 1992; MacMillan et al., 2000; Scull et al., 2003), image classification (see: Petry et al., 2005), decision support systems (McBratney and Odeh, 1997), hydrology and flood risk (Makropulos et al., 2008), ancient settlement studies and historical data (Borodkin, 1999; Barcelo ´ , 2005; Jasiewicz and Hildebrandt-Radke, 2009), and tourism (Ergin et al., 2003). Mamdani (Mamdani and Assilian, 1975) was among the first to apply fuzzy logic to build control systems based on Zadeh’s (1965, 1973) fuzzy set theory and fuzzy decision system (Zadeh, 1973). There are several implementations of fuzzy inference systems based on Mamdani’s solution in high-level mathematical and statistical programming environments such as Mathematica, MATLAB (MATLAB Fuzzy Logic Toolbox Documentation) or R (Meyer and Hornik (2009)). These systems, however, are designed to be used as control systems or decision support for small data sets. Their application for large GIS data sets comprising millions or tens of millions of cells (numbers of iterations) is time-consuming. Input/output operations (especially for large data sets) between GIS and external applications are additional bottlenecks. Hence, the full GIS implementation of inference systems capable of obtaining a satisfactory analysis time requires a low-level approach. The presented fuzzy system for GRASS GIS is a low-level implementation of Zadeh’s (1973) and Mamdani’s fuzzy inference system (Mamdani and Assilian, 1975), which is designed to work with GIS raster databases of any size and type supported by the GRASS GIS system. The GRASS GIS, an open-source GIS environ- ment (Neteler and Mitasova, 2008), was chosen because of its ability to process very large data sets with low memory load. The system consists of three modules: r.fuzzy.system, r.fuzzy.sets and r.fuzzy.logic. The r.fuzzy.system is not required to work with the two additional modules, which have been designed to perform basic fuzzy operations and overlays and to test intermediate results. All three modules are written in ANSI C using GRASS API and can be run on all platforms that support GRASS GIS. Like other GRASS programs, all modules use command line interface and GRASS Tcl/Tk or wxPython GUI’s. The proposed fuzzy system is not the first implementation of fuzzy logic in a GRASS GIS environment. For the 4.0 version of GRASS GIS, there is an external fuzzy logic system created by Franc - ois Delclaux in 2000. Unfortunately, it is no longer supported by current versions of GRASS. The system described in this paper is a completely new solution unrelated to GRASS 4.0. 2. Data processing Classical mathematical variables usually use numbers as values. Linguistic variables use linguistic values (linguistic terms), which Contents lists available at ScienceDirect journal homepage: www.elsevier.com/locate/cageo Computers & Geosciences 0098-3004/$ - see front matter & 2010 Elsevier Ltd. All rights reserved. doi:10.1016/j.cageo.2010.09.008 E-mail address: [email protected] Please cite this article as: Jasiewicz, J., A new GRASS GIS fuzzy inference system for massive data analysis. Computers and Geosciences (2010), doi:10.1016/j.cageo.2010.09.008 Computers & Geosciences ] (]]]]) ]]]]]]

Transcript of Jasiewicz 2011

Computers & Geosciences ] (]]]]) ]]]–]]]

Contents lists available at ScienceDirect

Computers & Geosciences

0098-30

doi:10.1

E-m

Pleas(201

journal homepage: www.elsevier.com/locate/cageo

A new GRASS GIS fuzzy inference system for massive data analysis

Jaros"aw Jasiewicz

Adam Mickiewicz University, Geoecology and Geoinformation Institute, Dziegielowa 27 60-081 Poznan, Poland

a r t i c l e i n f o

Article history:

Received 11 May 2010

Received in revised form

19 August 2010

Accepted 4 September 2010

Keywords:

Fuzzy logic

GIS

Data analysis

Inference system

GRASS

04/$ - see front matter & 2010 Elsevier Ltd. A

016/j.cageo.2010.09.008

ail address: [email protected]

e cite this article as: Jasiewicz, J., A n0), doi:10.1016/j.cageo.2010.09.008

a b s t r a c t

GIS systems are frequently coupled with fuzzy logic systems implemented in statistical packages. For

large GIS data sets including millions or tens of millions of cells, such an approach is relatively time-

consuming. For very large data sets there is also an input/output bottleneck between the GIS and external

software. The aim of this paper is to present low-level implementation of Mamdani’s fuzzy inference

system designed to work with massive GIS data sets, using the GRASS GIS raster data processing engine.

& 2010 Elsevier Ltd. All rights reserved.

1. Introduction

Many spatial phenomena show a degree of uncertainty thatcannot be expressed with clear-cut boundaries. In continuousspaces where it is difficult to clearly define boundaries, terms like‘‘close to’’, ‘‘suitable’’ and ‘‘small’’ can better express the character ofdivisions than a simple binary true/false classification (Burrough,1992, 1996). Additionally, fuzzy systems are useful on areas wheredata are incomplete or where there are only general rules of systembehaviour. Because of these qualities, fuzzy methods have beensuccessfully applied in numerous GIS fields such as data classifica-tion (Fisher, 1999; Demicco and Klir, 2004), geomorphology and soilmapping (Burrough, 1989; Burrough et al., 1992; MacMillan et al.,2000; Scull et al., 2003), image classification (see: Petry et al., 2005),decision support systems (McBratney and Odeh, 1997), hydrologyand flood risk (Makropulos et al., 2008), ancient settlement studiesand historical data (Borodkin, 1999; Barcelo, 2005; Jasiewicz andHildebrandt-Radke, 2009), and tourism (Ergin et al., 2003).

Mamdani (Mamdani and Assilian, 1975) was among the first toapply fuzzy logic to build control systems based on Zadeh’s (1965,1973) fuzzy set theory and fuzzy decision system (Zadeh, 1973).There are several implementations of fuzzy inference systemsbased on Mamdani’s solution in high-level mathematical andstatistical programming environments such as Mathematica,MATLAB (MATLAB Fuzzy Logic Toolbox Documentation) or R(Meyer and Hornik (2009)). These systems, however, are designedto be used as control systems or decision support for small datasets. Their application for large GIS data sets comprising millions ortens of millions of cells (numbers of iterations) is time-consuming.

ll rights reserved.

ew GRASS GIS fuzzy inferen

Input/output operations (especially for large data sets) betweenGIS and external applications are additional bottlenecks. Hence, thefull GIS implementation of inference systems capable of obtaining asatisfactory analysis time requires a low-level approach.

The presented fuzzy system for GRASS GIS is a low-levelimplementation of Zadeh’s (1973) and Mamdani’s fuzzy inferencesystem (Mamdani and Assilian, 1975), which is designed to workwith GIS raster databases of any size and type supported by theGRASS GIS system. The GRASS GIS, an open-source GIS environ-ment (Neteler and Mitasova, 2008), was chosen because of itsability to process very large data sets with low memory load. Thesystem consists of three modules: r.fuzzy.system, r.fuzzy.sets andr.fuzzy.logic. The r.fuzzy.system is not required to work with thetwo additional modules, which have been designed to performbasic fuzzy operations and overlays and to test intermediateresults. All three modules are written in ANSI C using GRASS APIand can be run on all platforms that support GRASS GIS. Like otherGRASS programs, all modules use command line interface andGRASS Tcl/Tk or wxPython GUI’s.

The proposed fuzzy system is not the first implementation offuzzy logic in a GRASS GIS environment. For the 4.0 version ofGRASS GIS, there is an external fuzzy logic system created by Franc-ois Delclaux in 2000. Unfortunately, it is no longer supported bycurrent versions of GRASS. The system described in this paper is acompletely new solution unrelated to GRASS 4.0.

2. Data processing

Classical mathematical variables usually use numbers as values.Linguistic variables use linguistic values (linguistic terms), which

ce system for massive data analysis. Computers and Geosciences

J. Jasiewicz / Computers & Geosciences ] (]]]]) ]]]–]]]2

are usually words. In the GIS fuzzy system, linguistic variables referto the original raster data (map), whereas linguistic values (terms)are equivalent to the fuzzy set created over every given mapaccording to a uniform definition. The inference process is definedby the set of fuzzy rules of the ‘‘IF antecedent THEN consequent’’type, where the antecedent is the conditional part and theconsequent is the conclusion part of the rule. The antecedentconsists of one or more fuzzy variables and terms connected by thesemantic operators (AND, OR); consequent consists of only onevariable and term, for example: ‘‘IF distance_to_river is near ANDelevation_above_river is low THEN risk is very high’’. The full fuzzysystem comprises input and output data, the fuzzy set definition, asystem of rules and an inference machine whose work can becontrolled by additional parameters.

2.1. Input data and fuzzy set definition

The input data for calculation are standard raster data stored inthe GRASS database. The system uses one or more maps of any type(i.e integer, float, double precision) and accepts all values appro-priate to the given data type. Any cell having a null value is ignoredduring data processing. The output is one (or optionally more)floating point raster map containing the final result. The analysisinvolves continuous data processing and does not require inter-mediate stages. The input information is passed to the system as atext file. The file contains map names used in the analysis (analogueof linguistic variables) and definitions of fuzzy sets (analogue of

Fig. 1. Examples of fuzzy sets m

Please cite this article as: Jasiewicz, J., A new GRASS GIS fuzzy inferen(2010), doi:10.1016/j.cageo.2010.09.008

linguistic values) for every map. The map file also includes oneoutput map definition. To identify the output map in the rule file, itmust be named _OUTPUT_, while the output map name is passed asa standard command parameter (see Appendix). The range of allsets in the output map is used to define the universe of theconsequent, while the resolution of the universe is also a commandparameter.

Membership modelling is very important in fuzzy logic con-cepts. In the proposed system, modelling of a fuzzy set is limited toa generalised trapezoid but with additional modification possibi-lities. It is also possible to define one-sided sets with only twopoints and information as to whether the points define the left orright boundary of the set. The shape of the boundary of the set maybe ‘‘linear’’, ‘‘s-, g- or j-shaped’’. Additional modifiers are hedge andheight. If the hedge parameter is other than from zero, dilatation(negative) or concentration (positive) is applied on the definedfuzzy set as many times as the number in the hedge field. The heightparameter defines the maximum membership of the set. Heightaffects both the maximum membership of the set and its bound-aries. This approach allows precise modelling of fuzzy set bound-aries without visual feedback. Examples of fuzzy sets based ondifferent definitions are shown in Fig. 1.

2.2. Rule parser

Since the described modules are designed for users to build theirown fuzzy inference systems, the most difficult problem is to

odelled with r.fuzzy.system.

ce system for massive data analysis. Computers and Geosciences

J. Jasiewicz / Computers & Geosciences ] (]]]]) ]]]–]]] 3

predict how many rules and how many variables will be used inevery rule. Similar to the input data, the rule system is passed to thesystem as a text file. The text file consists of rules where theconsequent names must be the same as the names of fuzzy setsdefined for the output map in the map file. To store rules, the fileuses the special syntax described in Table 4 and the programdocumentation. The text file is processed only once (includingsyntax error checking) at the beginning of the program run. Everyrule in the text file is parsed into two complementary FIFO queues,which store respectively the following tokens: (1) symbols ofvalues, operators and parenthesis; (2) pointers to the addresses inthe memory with current values. An additional queue keepspointers to fuzzy set definitions. The rule parsing process is basedon the idea implemented by Niemann (2010) and uses bottom-upshift reduce parsing (Aho et al., 2007), where tokens are shifted totwo stacks – operator stack and value stack – and the currentaction of the parser is determined by the precedence table. Thissolution makes that number of rules, and variables in rules are notarbitrarily limited. During data processing, the parser refers always

Fig. 2. Fuzzy inference procedur

Please cite this article as: Jasiewicz, J., A new GRASS GIS fuzzy inferen(2010), doi:10.1016/j.cageo.2010.09.008

to the same memory locations that store subsequently new dataduring processing of cells. Regardless of the size of input data,during processing all rasters are loaded into memory row by row;cells of each row are processed sequentially so memory loadingduring data processing does not exceed a few Mb, depending on thenumber of maps and the number of rules used in the analysis. Thisapproach allows the processing of massive data sets of any sizesupported by GRASS GIS system, even those in excess of the amountof available memory.

2.3. Inference machine

The process of fuzzy inference in the r.fuzzy.system consists offive steps that are similar to solutions in other software (Meyer,2009, MATLAB Fuzzy Toolbox Documentation): (1) fuzzification ofthe data; (2) application of fuzzy logic operators in the antecedent(3) implication from antecedents to consequents; (4) aggregationof all consequents across rules; (5) defuzzification. The first three

e in r.fuzzy.system module.

ce system for massive data analysis. Computers and Geosciences

Table 3Map file including fuzzy sets definition for presented example.

Syntax explanation:

%map_name;

$ set_name {border_side, points,border_shape,hedge,height}

J. Jasiewicz / Computers & Geosciences ] (]]]]) ]]]–]]]4

operations are performed separately for every rule; the fourthoperation aggregates into one fuzzy set, and the last operationchanges the fuzzy set (which cannot be stored in classical GIS data)into one value to store it in the resulting map (Fig. 2). All of thesesteps are iteratively repeated for every cell in the GRASS region. Theadditional parameters for controlling the inference process aresupplied as standard GRASS module parameters.

During the fuzzification process, original values are recalculatedinto membership grades for each fuzzy set associated with thegiven map. The result is a group of single values [0,1] equal to thenumber of sets for every map. Application of the fuzzy logicoperation is performed from left to right according to the stringof operators, variables and values stored in the antecedent sectionof every rule. If a rule contains an operator of negation, thecomplement of the original value is taken for further operations.Fuzzy logic operations may use different fuzzy logic familiespreviously defined in the program. There are six popular familiesavailable (see: Klement et al., 2000; Fodor, 2004; Bobillo andStraccia, 2009; Meyer and Hornik, 2009 and Table 1 for details). Theoperation results in a separate group of single values for everyantecedent. The number of antecedents is equal to the number ofrules. Because every rule has only one final antecedent value, thereis an additional option in the program that allows the user to outputall the antecedents as a set of maps. These maps use the final outputmap name as the prefix and the rule name (consequent) as thesuffix.

In the third step, every antecedent value is mapped onto theconsequent fuzzy set, resulting in a new consequent fuzzy set. Thisimplication procedure can use either of two options: a minimum,

Table 1Six fuzzy logic families available in GRASS fuzzy logic system (After Mayer& Horinik

2009): Zadeh: minimum (Godel) t-norm and maximum T-conorm; product:

product T-norm and probabilistic sum as T-conorm; drastic: drastic T-norm and

drastic T-conorm; Lukasiewicz: Lukasiewicz T-norm and bounded sum as a

T-conorm; Fodor: nilpotent minimum as T-norm and nilpotent maximum as

T-conorm; Hamacher (simplified): Hamacher product as T-norm and Einstein

sum as T-conorm.

Family T-NORM (semantic AND) T-CONORM (semantic OR)

Zadeh MIN(x,y) MAX(x,y)

Product xny x+y�xny

Drastic IF MAX(x,y)¼¼1 IF (MIN(x,y)¼¼0)

THEN MIN(x, y) THEN MAX(x,y)

ELSE 0 ELSE 1

Lukasiewicz MAX((x+y�1),0) MIN((x+y),1)

Fodor (nilpotent) IF (x+y)41 IF (x+yo1)

THEN MIN(x,y) THEN MAX(x,y)

ELSE 0 ELSE 1

Hamacher (simplified) IF (x¼¼0 99 y¼¼0) (x+y)/(1+xny)

THEN 0

ELSE (xny)/((x+y)�xny)

Table 2Performance tests of r.fuzzy.system due to (A) data resolution; (B) output universe reso

module performance.

(A) Module performance due to data resolution (universe resolution¼100; family¼Z

Resolution 280n380 699n950 1388n1

No. of cells 106400 664950 194181

Time 1.2 s 7 s 27 s

(B) Module performance due to universe resolution (data resolution¼1388n1399; fam

Resolution 15 25 50

Time (s) 6 9 16

(C) Module performance due to defuzzification method (data resolution¼1388n1399

Method centroid bisector min_of_

Time (s) 27.6 27.1 7.5

a Original Spearfish location with oversampled data.

Please cite this article as: Jasiewicz, J., A new GRASS GIS fuzzy inferen(2010), doi:10.1016/j.cageo.2010.09.008

where the result is the minimal value of the antecedent and currentconsequent for every element, or a product, where the result is aproduct of these values. The fuzzy set definitions for the conse-quents are stored in a map file with an output map.

Finally, all consequents are aggregated into a single consequentusing the semantic OR operator, and are defuzzified into a singlevalue. There are several defuzzification methods described byLeevick van and Kerre (1999). The methods used in the r.fuzzy.-system are: centroid (mass centre), bisector (fuzzy set divided intotwo equal area), Min. of highest, Max. of highest, Mean of highest.The result map contains floating point values of the outputuniverse. The additional category file shows also the membershipof every cell in particular output fuzzy sets; for example:high¼0.71 veryhigh¼0.29. These memberships for every cellcan be interactively checked by clicking on it.

2.4. Additional output and associated modules

For visual control of the intermediate stages, the program canoutput a fuzzy set definition for every map and consequents forevery rule, as well as aggregated consequents in the form ofcomma-separated lists of values that can be visualised by anyexternal software.

lution; and (C) defuzzification method. The fuzzy logic family has no influence on

adeh; defuzzification¼centroid).

399 2796n3798a 6990n9495a

2 10619208 66370050

1 min 46 s 10 min 55 s

ily¼Zadeh; defuzzification¼centroid).

100 200

27 51

; family¼Zadeh; universe resolution¼100).

highest max_of_highest mean_of_highest

7.6 8

%elevation

$ low {right; 2,4; sshaped; 0; 1}

$ moderate {both; 2,4,5,10; sshaped; 0; 1}

$ high {left; 5,10; sshaped; 0; 1}

%distance

$ near {right; 30,70; sshaped; 0; 1}

$ medium {both; 30,70,100,150; sshaped; 0; 1}

$ far {both; 100,150,200,300; sshaped; 0; 1}

$ veryfar {left; 200,300; sshaped; 0; 1}

%accumulation

$ low {right; 500,5000; sshaped; 0; 1}

$ $ high {left; 500,5000; sshaped; 0; 1}

%risk #output map

$ none {both; 0,20,20,40; linear; 0;1}

$ low {both; 20,40,40,60; linear; 0;1}

$ moderate {both; 40,60,60,80; linear; 0;1}

$ high {both; 60,80,80,100; linear; 0;1}

$ veryhigh {both; 80,100,100,120; linear; 0;1}

ce system for massive data analysis. Computers and Geosciences

J. Jasiewicz / Computers & Geosciences ] (]]]]) ]]]–]]] 5

Additional modules: the r.fuzzy.set and r.fuzzy.logic are notrequired to perform the inference process. The module r.fuzzy.setmay be useful for testing the result of applying any fuzzy set on theoriginal map, while r.fuzzy.logic allows the analysis of the results offuzzy operations (OR, AND, NOT) performed on fuzzified data withone of the proposed fuzzy logic families. Of course, these modulesmay also be used separately with other GIS tools.

3. Performance

The speed performance tests are presented in Table 2. Every testwas run after cold restart of the computer. All tests were performedon an AMD X2 250 processor with 4 Gb RAM and 64 bit Ubuntu 9.04as an operating system, and GRASS GIS version 6.5.svn (6 June2010). The input data and rule system were the same as in the casestudy example below. The relationship between number of cellsand computation time is linear. On testing machine about91,000711,000 cells per second were calculated, regardless ofdata resolution. Aggregation is the most resource-consuming partof the data processing, hence the universe resolution stronglyaffects computational time. If high precision is not required, theresolution can be set to the lowest value; however, with several ormore rules, low resolution may give highly inaccurate results. Thedefuzzification does not affect the computational time; the higher

Table 4Rules file for presented example.

Syntax explanation:

$ consequnet {antecedents}

¼: is;

�: is not;

9: OR;

&: AND

$ none {distance¼veryfar 9 elevation¼high}

$ low {distance�near & accum_abs¼high}

$ moderate {(distance¼medium 9 distance¼far) & (elevation¼ low 9elevation¼moderate)}

$ high {(distance¼medium & elevation¼ low)9(distance¼near &

elevation¼moderate)}

$ veryhigh {distance¼near & elevation¼ low}

Fig. 3. Source data (fuzzy variables) used in the case study: (A) Elevation with stream ne

accumulation map created with r.watershed; (C) watercourse distance to the stream; (D) w

in log10 of number of cells.

Please cite this article as: Jasiewicz, J., A new GRASS GIS fuzzy inferen(2010), doi:10.1016/j.cageo.2010.09.008

speed for the three last methods is due to code optimisation—in‘‘highest’’ cases, only the highest consequent is aggregated.

The r.fuzzy.system was compared with the fuzzy_inference()function from R-CRAN ‘‘Sets’’ package (Meyer, 2009) at the smallest(280n380 cells) resolution with a simple R script. However, thecomputation was still continuing after six hours, indicating thatthere was no comparison between the two approaches.

4. Case study example

The application of the GRASS fuzzy system is presented with asimple inference system prepared to detect the theoretical flood riskon a standard GRASS GIS dataset in Spearfish Country, South Dakota(available at: http://grass.osgeo.org/download/data6.php). From adigital elevation model of resolution 10 m per cell (elevation.10 mmap) the flow accumulation, stream network, watercourse distanceto streams and the elevation above streams were calculated with thenew r.stream toolset (Jasiewicz and Metz, submitted for publication).These data were used as linguistic variables and fuzzy sets ascribed tomaps as linguistic terms (see Table 3). The rule system assumes thatareas distant from the stream network or lying high above it are freefrom flood risk, that the low-lying areas or areas with a high flowaccumulation have at least a small flood risk and that areas lying nearthe stream channels have a high flood risk. The rule system ispresented in Table 4 and input data in Fig. 3. Three examples withresultant flood risk maps created with the (A) Zadeh fuzzy logicfamily and the centroid as the defuzzification method; (B) drastic andmax_of_highest; and (C) Hamacher and mean_of_highest respectivelyare presented in Fig. 4. Results show that both family and defuzzi-fication method affect the final result but the general conclusionsrequire more testing on different data sets and rule systems.

5. Conclusion

The proposed fuzzy logic system is a fast, easy-to-use tool thatenables the construction of customised fuzzy logic systems with-out any programming knowledge. For any data stored in rasterformat, it requires only the definition of the group of fuzzy sets overevery map and the preparation of the rule system. Of course, the

twork modelled with r.stream (Jasiewicz, Metz, submitted for publication); (B) MFD

atercourse elevation above the stream. All scales in meters, except (B) where scale is

ce system for massive data analysis. Computers and Geosciences

Fig. 4. Resultant flood risk calculated with three different fuzzy logic families and defuzzification methods: (A) Zadeh and centroid; (B) drastic and max_of highest;

(C) Hamacher and mean_of_highest. On the left of every image is a magnified inset of the outlined area.

J. Jasiewicz / Computers & Geosciences ] (]]]]) ]]]–]]]6

proper modelling of sets and rule systems is a separate issue that goesbeyond the scope of this paper. Its advantage is also the ability towork with even a huge GIS data sets with a small memory load. Theproposed system has modular structure and is extensible: additionalfuzzy logic families and defuzzification methods can be easily addedif needed, without rewriting the whole program. The fuzzy system isavailable as a GRASS add-on for software versions 6.4 and later.

Acknowledgments

I would like to thank Roger Bivand for encouraging me to writer.fuzzy.system module and Markus Metz for his help in codechecking. I would also like to thank anonymous reviewers for theirvaluable comments on the first version of this manuscript.

Appendix. GRASS commands required to reproduce theexample presented in the paper.

r.watershed -f elevation¼elevation.10 m@PERMANENTaccumulation¼accum

r.mapcalc accum_abs¼abs(accum)r.stream.extract elevation¼ ‘‘elevation.10 m@PERMANENT’’

threshold¼1000 stream_rast¼ ‘‘stream’’ direction¼ ‘‘dirs’’r.stream.order stream¼streams dir¼dirs horton¼hortonr.mapcalc ‘horton3¼ if(horton42,1,0)’r.stream.distance stream¼horton3 dir¼dirs dem¼eleva-

tion.10 m@PERMANENT distance¼distance elevation¼elevationr.fuzzy.system maps¼ ‘‘�/flood.map’’ rules¼ ‘‘�/flood.rul’’

family¼ ‘‘Zadeh’’ defuz¼ ‘‘centroid’’ imp¼ ‘‘minimum’’ res¼100output¼ ‘‘flood’’

r.fuzzy.system maps¼ ‘‘�/flood.map’’ rules¼ ‘‘�/flood.rul’’ famil-y¼ ‘‘drastic’’ defuz¼ ‘‘max_of_highest’’ imp¼ ‘‘minimum’’ res¼100output¼ ‘‘flood’’

Please cite this article as: Jasiewicz, J., A new GRASS GIS fuzzy inferen(2010), doi:10.1016/j.cageo.2010.09.008

r.fuzzy.system maps¼ ‘‘�/flood.map’’ rules¼ ‘‘�/flood.rul’’family¼ ‘‘Hamacher’’ defuz¼ ‘‘mean_of_highest’’ imp¼ ‘‘mini-mum’’ res¼100 output¼ ‘‘flood’’

References

Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D., 2007. Compilers: Principles, Techniques &Tools 2d. Ed. Pearson Educational 1038p.

Barcelo, J.A., 2005. Multidimensional spatial analysis in archaeology: Beyond the GISParadigm. In: Proceedings of the GIS Symposium Reading the Historical SpatialInformation in the World Studies for Human Cultures and Civilizations based onGeographic Information Systems held in Kyoto, Japan, February 7, 11, 2005.

Borodkin, L., 1999. Defining agricultural regions in Russia: fuzziness in multivariateclassification of historical data. History and Computing 11 (1–2), 31–42.

Bobillo, F., Straccia, U., 2009. Fuzzy description logics with general t-norms anddatatypes. Fuzzy Sets and Systems 160, 3382–3402.

Burrough, P.A., 1989. Fuzzy mathematical methods for soil survey and landevaluation. Journal of Soil Science 40, 477–492.

Burrough, P.A., 1992. Are GIS data structures too simple minded? Computers &Geosciences 18, 395–400.

Burrough, P.A., 1996. Natural objects with indeterminate boundaries. In: Burrough,P.A., Frank, A.U. (Eds.), Geographic Objects with Indeterminate Boundaries.Taylor and Francis, London, pp. 3–28.

Burrough, P.A., MacMillan, R.A., Deursen van, W., 1992. Fuzzy classification methodsfor determining land suitability from soil profile observations and topography.Journal of Soil Science 43, 193–210.

Demicco, R., Klir, G.J., 2004. Fuzzy Logic in Geology. Elsevier, Boston, p. 347.Ergin, A., Karaesmen, E., Micallef, A., Williams, A.T., 2003. A new methodology for

evaluating coastal scenery: fuzzy logic systems. Area 36 (4), 367–386.Fisher, P., 1999. Models of uncertainty in spatial data. 2d. Ed. In: Longley, P.,

Goodchild, M., Maguire, D., Rhind, D. (Eds.), Geographical Information Systems,vol. 1. Longman, Essex, pp. 191–205.

Fodor, J.C., 2004. Left-continuous t-norms in fuzzy logics: an overview. Journal ofApplied Sciences at Budapest Tech Hungary 1, 141–156.

Jasiewicz, J., Hildebrandt-Radke, 2009. Using multivariate statistics and fuzzy logicsystem to analyse settlement preferences in lowland areas of the temperatezone: an example from the Polish Lowlands. Journal of Archaeological Science36, 2096–2107.

Jasiewicz, J., Metz, M., r.stream: a new GRASS GIS toolkit for Hortonian analysis,Computers and Geoscience, submitted for publication.

Klement, E.P., Mesier, R., Pap, E., 2000. Triangular Norms. Kluwer AcademicPublishers 380p.

Leevick van, W., Kerre, E.E., 1999. Defuzzification: criteria and classification. FuzzySets and Systems 108, 159–178.

ce system for massive data analysis. Computers and Geosciences

J. Jasiewicz / Computers & Geosciences ] (]]]]) ]]]–]]] 7

MacMillan, R.A., Pettapiece, W.W., Nolan, S.C., Goddard, T.W., 2000. A genericprocedure for automatically segmenting landforms into landform elementsusing DEMs, heuristic rules and fuzzy logic. Fuzzy Sets and Systems 113, 81–109.

Makropulos, C.K., Butler, D., Maksimovic, C., 2008. Buliding decision support systemsbased on Fuzzy inference. In: Abrahart, R.J., See, L.M., Solomatine, D.P. (Eds.), PracticalHydroinformatics. Springer-Verlag, Berlin-Heidelberg, pp. 215–230.

Mamdani, E.H., Assilian, S., 1975. An experiment in linguistic synthesis with a fuzzylogic controller. International Journal of Man–Machine Studies 7, 1–13.

MATLAB Fuzzy Logic Toolbox Documentation, /http://www.mathworks.com/access/helpdesk/help/toolbox/fuzzy/S.

McBratney, A.B., Odeh, I.O.A., 1997. Application of fuzzy sets in soil science: fuzzylogic, fuzzy measurements and fuzzy decisions. Geoderma 77, 85–113.

Meyer, D., Hornik, K., 2009. Generalized and customizable sets in R. Journal ofStatistical Software 31 (2), 1–27.

Please cite this article as: Jasiewicz, J., A new GRASS GIS fuzzy inferen(2010), doi:10.1016/j.cageo.2010.09.008

Meyer, D., 2009. Description of Sets Package. /http://www.r-project.org/web/packages/sets/sets.pdfS.

Neteler, M., Mitasova, H., 2008. Open Source GIS: A GRASS GIS approach 3rd ed.Springer, New York 406p.

Niemann, T., 2010, Operator’s Precedence Parsing./http://www.epaperspress.com/oper/S (accessed 04.07.10).

Petry, F.E., Robinson, V.B., Cobb, M.B. (Eds.), 2005. Springer, Berlin-Heidelberg-New York.Scull, P., Franklin, J., Chadwick, O.A., McArthur, D., 2003. Predictive soil mapping: a

review. Progress in Physical Geography 27, 171–197.Zadeh, L., 1965. Fuzzy sets and systems. In: Fox, J. (Ed.), System Theory. Polytechnic

Press, Brooklyn, NY, pp. 29–39.Zadeh, L., 1973. Outline of a new approach to the analysis of complex systems and

decision processes. IEEE Transactions on Systems, Man and Cybernetics 3,28–44.

ce system for massive data analysis. Computers and Geosciences