1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example 1. Example: Fuzzy Site Analysis The objective of this analysis is to find i...
Author: Juliana Hancock
10 downloads 1 Views 665KB Size
Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

1. Example: Fuzzy Site Analysis The objective of this analysis is to find ideal locations according to given criteria using a fuzzy logic approach instead of crisp class boundaries.

Problem Statement Given a 1 : 24,000 digital topographic data set of Boulder, Colorado, determine a suitable site that meets the following criteria: 1. Flat slope 2. Favorable aspect 3. Moderate elevation 4. Near a lake or reservoir 5. Not close to a major road 6. Not in a park or military installation

Data Preparation The data set is downloaded from the USGS server http://mapping.usgs.gov as compressed archives in SDTS format. The elevation model can be downloaded from http://data.geocomm.com/dem/. Do not forget to download the master data dictionary. The archives can be read and unpacked with, for instance, the WinZip program. With the help of the sdts2cov.aml the SDTS transfer files can be imported into ArcInfo. This AML will resolve one-to-many relationships in the transfer set and can also assign feature attributes as text instead of DLG feature codes. The following layers are needed (others can be added for cartographic purposes): • Boundaries • Hydrography • Transportation • Elevation model All layers, except the elevation model, are stored as coverages. The elevation model will be stored as a grid.

Fuzzy Concepts Slope is considered flat when it is below 10 degrees. The aspect is favorable when the terrain is either flat or oriented towards southeast, south, or southwest. In this part of the country, any elevation above 1,350 meters and below 2,150 meters is moderate with an “ideal” elevation between 1,700 and 1,800 meters. Every location within 1 kilometer from a water body (lake or reservoir) is near that feature. Close to a major road means within a buffer of 300 meters. In this example, we consider a major road to be US 36, SR 7, SR 93, or SR 119. Instead of classes with crisp boundaries (yes/no-membership) we represent the features meeting the criteria as fuzzy sets with a degree of membership from zero to one. We apply linear membership functions for the fuzzy sets as follows:

1

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

Flat Slope

⎧ 20 − x ⎪⎪ 20 μflat slope ( x) = ⎨ ⎪ 0 ⎪⎩

x ≤ 20 x > 20

Membership Grade 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 U 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Favorable Aspect

⎧ ⎪ 0 ⎪ ⎪ x − 90 ⎪ 90 μfavorable aspect ( x) = ⎨ ⎪ 1 ⎪ ⎪ 270 − x ⎪ ⎩ 90

0 ≤ x ≤ 90 or 270 ≤ x ≤ 360 90 < x ≤ 180 x = −1 180 < x < 270

Membership Grade 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 U 0

45

90

135

180

2

225

270

315

360

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

Moderate Elevation

x < 1000 or x > 2500 ⎧0 ⎪ x − 1000 ⎪ 1000 ≤ x ≤ 1700 ⎪ 700 μmoderate elevation ( x) = ⎨ 1700 < x < 1800 ⎪1 ⎪ (2500 − x) 1800 ≤ x ≤ 2500 ⎪ ⎩ 700 Membership Grade 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 U 1000

1200

1400

1600

1800

2000

2200

2400

Close to (with a crisp threshold value of a)

⎧ 2a − x ⎪⎪ 2a μclose to ( x) = ⎨ ⎪ 0 ⎪⎩

x ≤ 2a x > 2a

Membership Grade 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 U 0

a

3

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

Software Approach In principle, there are four ways to solve the problem: we can use ArcInfo GRID, ArcMap Spatial Analyst, or ArcView 3.x Spatial Analyst. The fourth option is to use scripts in ArcGIS 9. In the following all approaches are illustrated. The grids involved are SLOPE (slope), ELEVATION (elevation model), ASPECT (aspect), WATERDISTANCE (distance from water body), and ROADDISTANCE (distanced from major road). The resulting fuzzy sets are FSLOPE (moderate slope), FELEVATION (moderate elevation), FASPECT (favorable aspect), FWATER (near a water body) and FROAD (not close to a major road).

ArcInfo GRID To compute the fuzzy sets we use an AML script fuzzy.aml that is run from ArcGrid: /* /* Flat slope /* ============== /* /* linear membership function: /* /* membership grade 1 at 0 slope /* membership grade 0 at 20 slope /* docell if (slope gt 20) fslope = 0 if (slope le 20) fslope = (20 - slope) / 20 end /* /* moderate elevation /* ================== /* /* linear membership function: /* docell if (elevation gt 2500 | elevation lt 1000) felevation = 0 if (elevation gt 1700 & elevation lt 1800) felevation = 1 if (elevation ge 1000 & elevation le 1700) felevation = (bdem - 1000) / 700 if (elevation gt 1800 & elevation le 2500) felevation = (2500 - bdem) / 700 end /* /* Favorable aspect /* ================ /* /* trapezoidal membership function: /* /* best at south, decreasing towards west-north and east-north /* docell if ( aspect eq -1) faspect = 1 if ((aspect ge 0 & aspect le 90) | ~ (aspect ge 270 & aspect le 360)) faspect = 0 if ( aspect gt 90 & aspect le 180) faspect = (aspect - 90) / 90 if ( aspect gt 180 & aspect lt 270) faspect = (270 - aspect) / 90 end /* /* near a water body (linear membership function) /* docell if (waterdistance gt 2000) fwater = 0 else fwater = (2000 - waterdistance) / 2000 end /* /* not close to a major road /* docell if (roaddistance gt 600) froad = 1 else froad = roaddistance / 600 end

4

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

This can be easily automated by additional AML Scripts, forms and menus.

ArcMap Spatial Analyst To solve the problem we use the raster calculator of the Spatial Analyst. The following screen dumps show the commands to produce the necessary fuzzy sets. Flat Slope

Moderate Elevation

5

Introduction to Fuzzy Logic and Applications in GIS Favorable Aspect

Fuzzy Road Condition

6

Illustrative Example

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

Fuzzy Water Body Condition

All the commands could be issued in one ArcMap raster calculator session.

ArcView 3.x If you do not have ArcGIS available, the same results can be achieved by using requests in the ArcView 3.x Spatial Analyst map calculator. The following screen dump shows how to use the Avenue Con request for computing the fuzzy set for flat slope.

7

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

The remaining fuzzy sets can be computed in a similar way modifying the raster calculator commands used in ArcMap Spatial Analyst in the previous sections. Another approach is to use Avenue Scripts. An excellent example are the MapModels by Leopold Riedl, University of Technology, Vienna. This is an easy to use modeling environment that also allows for fuzzy set analysis in ArcView 3.x. For more information and a trial version visit http://www.srf.tuwien.ac.at/MapModels/MapModels_English.htm .

Result The following figure shows the results of the analysis with a fuzzy logic approach (top map) and a crisp approach (bottom map). The grid size has been set to 10 meters according to the grid cell size of the elevation model. The fuzzy intersection was computed with the multiplication operator (i.e., “soft” intersection). You can see that with the fuzzy approach a more differentiated result is achieved showing degrees of membership to the desired criteria between 0 and 1 (the darker the higher the membership degree).

8

Introduction to Fuzzy Logic and Applications in GIS

Figure 1. Crisp result

9

Illustrative Example

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

Figure 2. Fuzzy result

Both cases were computed using the Model Builder in ArcGIS 9. For the fuzzy case a tool written as a Python script to create a fuzzy set was used.

10

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

Crisp Model

11

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

Fuzzy Model

12

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

2. Example: Fuzzy Inference The objective of this analysis is to perform fuzzy reasoning based on the simplified method.

Problem Statement Given the slope and the aspect of a 1 : 24,000 digital topographic data set of Boulder, Colorado, and the following set of rules, we can conduct a risk analysis based on degrees of risk ranging from 1 (low risk) to 4 (very high risk). Rule 1 Rule 2 Rule 3 Rule 4

If slope is flat and aspect is favorable then risk is 1 If slope is steep and aspect is favorable then risk is 2 If slope is flat and aspect is unfavorable then risk is 1 If slope is steep and aspect is unfavorable then risk is 4

Data Preparation The data are taken from the previous example.

Fuzzy Concepts Slope is considered flat when it is below 10 degrees. Slope is not steep when it is below 5 degrees; it is considered steep at 17.5 degrees which becomes the cross over point of our fuzzy set. The aspect is favorable when the terrain is either flat or oriented towards southeast, south, or southwest, i.e., between 135 and 225 degrees. For unfavorable aspect we choose the complement of favorable (see below). We apply linear membership functions for the fuzzy sets as follows:

Flat and Steep Slope

Membership 1

flat 0.8

steep

0.6 0.4 0.2

0

10

20

30

13

40

Percent

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

Favorable and Unfavorable Aspect

favorable

Membership 1 0.8 0.6

unfavorable

0.4 0.2

0

50

100

150

200

The fuzzy model is illustrated on the next page.

14

250

300

350

Introduction to Fuzzy Logic and Applications in GIS

15

Illustrative Example

Introduction to Fuzzy Logic and Applications in GIS

Illustrative Example

The result is shown in the following figure where the risk ranges from low (green) through moderate (yellow) to high (orange) and very high (red).

16