16
Introduction to Fuzzy Logic and Applications in GIS Illustrative Example 1 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. Example: Fuzzy Site Analysis

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

1

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:

Page 2: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

2

Flat Slope

flat slope

20 2020( )0 20

x xx

−⎧ ≤⎪⎪= ⎨⎪ >⎪⎩

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21U

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Membership Grade

Favorable Aspect

favorable aspect

0 0 90 or 270 360

90 90 18090( )1 1

270 180 27090

x x

x xx

x

x x

μ

⎧ ≤ ≤ ≤ ≤⎪⎪

−⎪ < ≤⎪= ⎨⎪ = −⎪⎪ −⎪ < <⎩

0 45 90 135 180 225 270 315 360U

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Membership Grade

Page 3: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

3

Moderate Elevation

moderate elevation

0 1000 or 25001000 1000 1700

700( )1 1700 1800(2500 ) 1800 2500

700

x xx x

xx

x x

μ

< >⎧⎪ −⎪ ≤ ≤⎪= ⎨ < <⎪⎪ −

≤ ≤⎪⎩

1000 1200 1400 1600 1800 2000 2200 2400U

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Membership Grade

Close to (with a crisp threshold value of a)

close to

2 22( )0 2

a x x aax

x aμ

−⎧ ≤⎪⎪= ⎨⎪ >⎪⎩

0 aU

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Membership Grade

Page 4: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

4

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

Page 5: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

5

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

Page 6: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

6

Favorable Aspect

Fuzzy Road Condition

Page 7: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

7

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.

Page 8: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

8

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).

Page 9: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

9

Figure 1. Crisp result

Page 10: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

10

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.

Page 11: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

11

Crisp Model

Page 12: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

12

Fuzzy Model

Page 13: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

13

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 If slope is flat and aspect is favorable then risk is 1 Rule 2 If slope is steep and aspect is favorable then risk is 2 Rule 3 If slope is flat and aspect is unfavorable then risk is 1 Rule 4 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

0 10 20 30 40Percent

0.2

0.4

0.6

0.8

1Membership

0 10 20 30 40Percent

0.2

0.4

0.6

0.8

1Membership

flat

steep

Page 14: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

14

Favorable and Unfavorable Aspect

0 50 100 150 200 250 300 350

0.2

0.4

0.6

0.8

1Membership

0 50 100 150 200 250 300 350

0.2

0.4

0.6

0.8

1Membership favorable

unfavorable

The fuzzy model is illustrated on the next page.

Page 15: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

15

Page 16: 1. Example: Fuzzy Site Analysis

Introduction to Fuzzy Logic and Applications in GIS Illustrative Example

16

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).