Você está na página 1de 11

GEO/EVS 425/525 Unit 8 Using the ERDAS Imagine Spatial Modeler

This exercise will introduce you to the use of ERDAS Im agines Spatial Modeler. This is a program m ing function built into Im agine that enables you to carry out a large number of operations that are not built into

the buttons that appear when you open the various modules on the Imagine Control Panel. Most, if not all GIS/Remote Sensing software packages have similar modeling packages. The ERDAS spatial modeler has three parts: The Spatial Modeler Language is the basis for all GIS functions in ERDAS IMAGINE, and it is the most powerful. It is a modeling language that allows you to create script (text) models for a variety of applications. It is also the most arcane and difficult to use. Using models written in SML, you can create custom algorithms that best suit your data and objectives. A model is a set of instructions for performing geoprocessing operations. Models can be created graphically with Model Maker or in text form. Modeling with Model Maker is similar to drawing a flow chart. Model Maker is essentially the Spatial Modeler Language with a graphical interface. This enables you to create graphical models using a palette of easy-to-use tools. Graphical models can be run, edited, saved in libraries, or converted to script form and edited further using the Spatial Modeler Language. Because this is the most straightforward introduction to the Spatial Modeler language, this exercise will concentrate on using the Model Maker. The Image Interpreter houses a set of common functions that were created using either Model Maker or the Spatial Modeler Language. They have been given a dialog interface to match the other processes in ERDAS IMAGINE. You have already used some of these functions: They are the ones available from the Interpreter button on the Imagine Control Panel. In most cases, you can run these processes from a single dialog. However, the actual models are also delivered with the software, so that you can edit these if you desire more customized processing. Model Maker is not only very easy to use, it is also powerful-providing access to over 200 functions and operators in 23 categories, including: Analysis Arithmetic Bitwise Boolean Color Conditional Data Generation Descriptor Distance Exponential Focal (Scan) Focal Apply Opts Focal Use Opts Global Matrix Other Relational Size Stack Statistical Statistical String Surface Trigonometric Zonal

You can manipulate raster layers, vector layers, matrices, tables, and scalars. In doing so, you can create your own algorithms to best address the goals of your project and data set. All of the graphical models you create in Model Maker have the same basic structure: input, function, output. The number of inputs, functions, and outputs can vary, but the overall form remains constant. All components must be connected to one another before the model can be run. The basic form of a model is shown in the figure to the right. It shows two models: a simple one, in which a single input leads to a single output, and a more complex one, in which a single input leads to an output which becomes an input, along with two others, to a second function which leads to the final output. Figure 1: Basic Structure of Spatial Models

To create a graphical model using the Model Maker, you have to follow what is in essence a 6-step process, as indicated in Figure 2. Problem definition has to be done by you. It is best to think the problem out before you begin to work with the computer (this is always a good idea!). The other 5 operations are done on the Model Maker screen. Object graphics are the tools that represent objects: images, arc coverages, tables, functions, etc. You connect them with lines that show the interrelationships among them. You define the objects by indicating what objects they are and what certain of their characteristics are. You define the functions and operators by specifying the relations involved with them. Then you run the model. If you are very good (most of us arent), everything will be fine as you run it the first time. More likely, you will need to refine your model. This will involve going back and placing more object graphics on the screen, revising your connections, redefining objects, functions, or operators, and rerunning the model. Your first step in carrying out any m odel is to start
the Model Maker. Be sure that a Viewer is open, and click on Modeler-Model Maker. The Model Maker viewer and tool palette open. These are shown in Figure 3. The Model Maker viewer opens blank, with sim ply the tool palette. Im agine includes several sam ple graphical m odels that you can use as tem plates to create your own m odels.

Figure 2: Basic Approach to Spatial Modeling

An example of a model is shown in Figure 4. Before you can begin to create a model, you need to know what objects can be placed in the Model Maker viewer and what each of the icons in the tool palette do.

Figure 3: Blank Model Five types of file objects can be placed in the Model Maker Screen, with Maker viewer. These are summarized in Figure 5. Tool Palette Their icons are indicated, along with their definition.

Figure 4: Example of a Spatial Model

Figure 5: Types of File Objects Used in Spatial Models

In addition, you can place two types of function objects in the Model Maker viewer. These are Functions and Criteria. These are not files, but rather are relationships between the inputs and outputs which you must specify. The Model Maker tool palette consists of 11 icons. These are defined, along with their operation, in Figures 6 and 7: Figure 6: Some Icons Used by the Spatial Modeler In all cases, you place an object in the Model Maker viewer by clicking on its icon and then clicking in the viewer in the position you wish to place it. The object graphic will appear. If you wish to place several of the same objects in the viewer, you should click on the lock icon on the tool palette and then click on the object icon you wish to place. This will allow you to place as many object graphics of this sort as you like. If you do not have the lock icon activated, the cursor will return to the pointer mode after you have placed your object graphic in the Model Maker viewer. You connect objects by clicking on the Connect icon and dragging the mouse (holding down the left mouse button) from one object to another. In all cases, the directionality of the connection is crucial. If, for example, you are connecting a file object to a function object, the file object will be the input to the function. If, on the other hand, you are connecting a function object to a file object, the file object will be the output of the function. Again, you can use the lock icon to connect a large number of objects at one time. To define an object, you double-click on its graphic in the Model Maker viewer and Figure 7: More Icons Used by the Spatial Modeler fill in the appropriate fields in the dialog which opens. This dialog will contain both fields containing default values and other fields which are blank. You can often accept the defaults, but you should always look at them. Blank fields virtually always need to be filled in in order for the model to run. We are now ready to proceed. In this exercise, you will create two models. In the first, you will combine satellite imagery, land-cover data, and slope information to do an exercise in environmental planning. In the second, you will develop a model for a flood situation and then refine the model in several steps to improve it.

Environmental Planning
In the first example, envision yourself as an environmental planner in Del Mar, California. You want to identify the most environmentally sensitive areas in the region so that they can be protected. To give these sensitive areas perspective, you will overlay them onto a satellite image. You will first need a satellite image of the area and thematic layers that will be used for determining environmental sensitivity. Because the satellite image will be used as a reference, you will use SPOT panchromatic data. The 10 meter resolution provides good spatial detail. In addition, the black-and-white image will not detract from the colors in the overlain sensitivity analysis. You will base your interpretation of environmental sensitivity on the following three factors: flood plain - low lying areas, or flood plains, are not suitable for development due to their fragile and changeable condition. In this instance, flood plain was identified by identifying buffers around first- through fourth-order streams to approximate the actual flood plain. This is not how a real environmental scientist would wish to identify the flood plain, but what alternatives do you have? Think about this question! land cover - a land cover classification of the area was produced Figure 8: Basic layout of the using Landsat Thematic Mapper data. We shall look at the Environmental Sensitivity process by which this is done in later exercises. The Riparian Model and Wetlands classes are the most environmentally sensitive land cover types. slope - slopes greater than 25 percent should be protected because of erosion potential. You should note that these definitions are somewhat arbitrary. Most such definitions are. The question is whether they are reasonable or not, based on the needs of the decision-makers involved with the project and the science that underpins it. In this case, the definitions are probably adequate. Refining them would be part of the Additional Processes process shown in Figure 2, above. This model will incorporate three phases. Each phase includes a simple model, with inputs, a function, and an output. The output layers derived from the first two phases will be the inputs in the last phase to create the final product. These three steps will be combined into one graphical model, as shown in Figure 8. The three phases are: Create sensitivity layer - the first phase of the model will be to combine the three thematic layers into one sensitivity layer. The thematic layers will serve as the inputs to the model; the sensitivity layer will be the output. Enhance SPOT data - to increase the sharpness and contrast of the SPOT layer, you will run a convolution kernel over it. Combine sensitivity layer with SPOT data - create the final product by combining the thematic sensitivity layer and the SPOT satellite data. Open the Model Maker Viewer, and click on the lock icon. Click on the Raster icon on the tool palette, and then click in the Model Maker viewer in four different places to place 3 input raster object graphics and 1 output raster object graphics. Click on the Function icon on the tool palette and then place a function object graphic between the input raster objects and the output raster object. Then click on the Connect icon on the tool palette and connect the 3 input raster graphics to the function and the function to the output raster graphic. Your model should resemble Figure 8. The images you will be working with cover somewhat different areas. You will therefore need to tell Imagine that you want to work with the Intersection of the input files rather than with the Union. You will recall that the Intersection of two spatial files refers only to the area common to both files, whereas the

Union of two spatial files includes all of the area found in either. Click on Model-Set Window to define the working window, and choose Intersection in the Set Window to field. Click on OK. Click on the first input raster object graphic. The Raster graphic dialog opens. Click on the Open object icon in the File Name field, and choose SLOPE.IMG as the first input. As with many slope images, this image has some noise around the edges that you should eliminate. You can eliminate the noise by taking a subset of the image. Open the SLOPE.IMG file into a regular viewer, choosing the Fit to Frame option. Right-click the viewer to open the hidden functions for the viewer, and choose Inquire Box. A dialog opens, and a white inquire box opens near where you right-clicked the viewer. Drag the inquire box to the desired image area. You can increase or decrease the size of the inquire box by pointing at the sides or corners of the box, holding down the left mouse button, and moving the mouse. You should choose to include as much of the image as you can minus the noise at the edge of the image. Now go back to the Raster graphic dialog in Model Maker. In the Processing Window section of the dialog, choose From Inquire Box. The coordinates in the inquire box dialog and the processing window section of the Raster graphic dialog are now the same. Close the Inquire Box dialog, but leave the Raster graphic dialog open. You have defined the sensitive slopes as those over 25% in your definition of the problem. The SLOPE.IMG file contains information about all slopes in the area. You need to recode the image so that only those slopes of 25% and higher are considered sensitive. That is, they will have the value of 1', while slopes less than 25% will have the value of 0'. Click on the Recode Data radio button and then on the Setup Recode button. The recode dialog opens. It resembles the Raster Attribute table (it should; it essentially is the Raster Attribute table). Your non-sensitive classes are classes 1-4, and you sensitive classes are 5-8. Right-click the recode dialog with your cursor in the Value column to open the hidden functions. Choose Criteria. Using your mouse, create the criteria statement $Value > 4, and Select the records that meet the criteria. Close the criteria dialog. The New Value in the Recode dialog should be equal to 1'. Click on Change Selected Rows to change the values to 1. Now rightclick the Value column of the Recode dialog and choose Invert Selection. Place 0' in the New Value column, and click on Change Selected Rows. Click OK in the Recode dialog, and then click OK in the Raster object dialog. Both close, and the first raster graphic object is now labeled n1_slope_RC. You have defined the first object. Double-click on the second input raster graphic object. Select FLOODPLAIN.IMG for the files name. This image is already a Boolean image, so it does not have to be subset or recoded. Click on OK. The object is now labeled n2_floodplain. Double-click on the third input raster graphic object. Select LANDCOVER.IMG as the file name. To see what is in this file, click on the Recode Data radio button and then on the Setup Recode button. The recode dialog opens, showing you that there are 5 categories of undeveloped land, plus category 6 (water) and category 0 (developed land). The sensitive categories have a value of 1 for riparian vegetation and 4 for wetlands. Change the value of riparian vegetation to 4 and the value of every other vegetation type to 1. There are several ways to do this, but here is the easiest. Select the riparian vegetation row by clicking on the 1' in the Value column. Put the number 4' in the New Value box, and Change Selected Rows to recode riparian vegetation as 4'. Now Invert Selection to select all other rows in the table. Holding the shift key down (this is important), click on row 4 to deselect Wetlands and then click on row 0 to deselect the developed land. Enter 1' in the New Value box, and Change Selected Rows. Now Riparian Vegetation and Wetlands are recoded to 4, and all other vegetation types are recoded to 1. Click on OK. The land cover raster graphic object is now labeled n3_landcover_RC. Your inputs are now complete. The sensitive vegetation is coded to 4; the slopes and lands within flood plains are coded to 1, and all other areas are coded to 0. You now need to define the function graphic object. Double-click on it. When the Function Definition dialog opens, you notice that it lists 3 available inputs on the left side of the dialog (not surprising, since youve defined three, and all 3 input graphic objects are connected to the function graphic object), has a

keypad in the center, and lists Functions on the right-hand side. At the bottom of the dialog there is a window for the function statement. Click on the pop-up window to the right of Functions: to get to the list of function classes. Choose Conditional. Click on the CONDITIONAL function to copy it to the Function Statement window. Using your mouse as much as possible (you will need to use the delete key to remove the final ellipsis, but you should use the mouse for everything else), create the following conditional statement in the Function Statement window: CONDITIONAL {($n3_landcover_RC == 4)4, ($n1_slope_RC == 1)3, ($n2_floodplain == 1)2, ($n3_landcover_RC == 0)0, ($n3_landcover_RC == 1)1}. To use the modeler, move the cursor to the appropriate prototype of the function (i.e. <tests> or <args>), then click on that item in the Conditional statement to indicate that you want to replace the generic item with a specific reference. Click on the appropriate file name in the Available Inputs window. You will see that it replaces the generic item. To add parentheses, numbers, and commas, use the keypad. To add the double-equal sign (==), go to Relational functions using the Functions: popup. What this function does is to set up a new output attribute table, in which class 0 is developed land, class 1 is undeveloped land not otherwise sensitive, class 2 is land in the flood plain, class 3 is land in slopes greater than 25%, and class 4 is riparian vegetation and wetland. Double-check the conditional statement to make sure that it is correct. The model will not run if the information has been entered incorrectly or incompletely. Click on OK. The Function Definition dialog closes, and the function is now labeled CONDITIONAL. Be sure that you understand this step. It is difficult to explain, but its really quite straightforward when you actually do it, and its the basis of using the Modeler. Double-click on the output raster graphic object. Give it a name. Be sure that your X: directory is listed as the active directory. Click the Delete if Exists checkbox. This will automatically overwrite an existing file with the same name if the model is run again. Choose Thematic as the File Type. Click OK. Save the model. You can do so either by clicking on the File Save icon or by clicking on File-Save As on the Model Maker menu bar. Be sure that you are saving the model on your X: drive. Run the model. You can do this by clicking on Process-Run from the Model Maker menu bar or by clicking on the lightning bolt icon. If the model runs correctly, the status bar will go to 100% without an error. You can click on OK in the status box when the model has run. Look at the results. Now you will create a second simple model to enhance the SPOT data. Open a second Model Maker viewer to create a New model. Place one raster input object and one raster output object in the viewer. Place a Matrix object as a second input and a Function object between the inputs and output. Connect the two input objects to the Function, and Connect the Function to the output object. Define the input Raster object. It is a file named SPOTS.IMG. You can accept all defaults for this file. No recoding is needed. Define the Matrix object. When you double-click on the Matrix object, the Matrix Definition dialog opens. You have access to built-in, custom matrix, read, or output matrices as options. Choose the built-in option. From the Kernel: popup, choose Summary as the matrix to use and 5x5 as the size. The kernel is displayed. You will notice, from our class discussion of filters, that it is a sharpening filter. Now define the Function object. When the Function Definition dialog opens, the open Function set is Analysis. Last time, you had to change this, first to Conditional and then to Relational. This time, you actually want an Analysis function. Specifically, you want to Convolve the spot image with the filter. Convolving is a complex way of saying that you want to run the filter over the raster. In this case, you will convolve the image in order to sharpen it. Click on CONVOLVE to copy the Convolve statement

to the Function statement window. Click on <raster> and then $n1_spots, then click on <kernel> and then $n3_Summary. Click on OK. Now define the output Raster graphic. Be sure that it is on your X: drive. Give it a name, click on Delete if Exists, and confirm that the output will be a Continuous File Type. Click on OK. Save the model on your X: drive, and run it. Look at the results. You will now combine the two models. On the menu bar of the second Model Maker viewer, click on Edit-Select All. Click on the Copy icon (or click on Edit-Copy) to copy the model to the buffer. Click on the Paste icon of the first model (or click on Edit-Paste) to copy the second model into the first Model Maker viewer. Close the second Model Maker viewer. Move the two models in the first Model Maker viewer so that they do not overlap. Click on a blank portion of the viewer to deselect everything. Move the objects around in the Model Maker viewer so that you can add more stuff easily. The outputs of the first two models will now serve as inputs to the combination. Add a Function object, and connect the output Raster objects from the first two models to it. Add a Scalar object to the viewer, and connect it to the new Function object. Finally, add a Raster graphic object as an output, and Connect the Function to it. Double-click on the Scalar object. Enter a Value of 5' and set the Type to Integer. Click on OK. Double-click on the new Function object. You will see three inputs: the thematic output raster from the first model, the enhanced SPOT output raster from the second model, and the integer scalar. From the Functions: popup, choose Conditional and choose EITHER as the conditional function to copy to the Function Statement window. Click on the first prototype <arg1> and choose the thematic output from the first model. Then click on the prototype <test> and again choose the thematic output from the first model. If that thematic output is called thematic.img, your function definition would now read, EITHER $n4_thematic IF ( $n4_thematic ) OR <arg2> OTHERWISE This statement means that the resulting output raster image will be taken from the thematic map for all pixels in which the thematic map has a value other than zero and that those pixels for which the thematic map has a value of 0 will take their new value from another source. To define that source, click on the Functions: popup and choose Analysis. Click on the prototype <arg2>, and scroll down the list of Analytical functions until you find STRETCH. Click on the first STRETCH to replace the prototype <arg2> with the stretch function. Click on the <raster> prototype and then click on the enhanced SPOT input. Click on the <stdcount> prototype, and replace it with the number 2' on the keypad. Likewise, replace the <min> prototype with 0' and the <max> prototype with 250. What you have just done is to say that where the thematic map has a pixel value of 0, replace it with the enhanced SPOT image where the SPOT image has been stretched two standard deviations between 0 and 250. We now need to insure that there are no values in the output raster from the SPOT image between 0 and 4, since these are the values from the thematic image. To do this, click in front of the OTHERWISE. Add + from the keypad and the integer scalar input from the Available Inputs. If you called your enhanced SPOT image enhancedSPOT.img, your function definition should now read, EITHER $n4_thematic IF ( $n4_thematic ) OR (STRETCH ( $n7_enhancedSPOT, 2, 0, 250 ) + $n11_Integer) OTHERWISE Now define your output raster layer as a Thematic image, as before. Save the model, and run it. Look at the resulting file. Using the Raster Attribute table, change the colors of the thematic variables (1, 2, 3, and 4) so that they are easier to see. This image should be included in your portfolio for this unit.

Note that in this process, you start with four input rasters, an input matrix, and an input scalar to get two intermediate output rasters and a final output raster. You do not really need to save the intermediate rasters. If you go back to your model and double-click on them, you can change them to Temporary Raster Only by checking the appropriate checkbox. The function definition using these rasters as inputs is updated automatically. Eliminating intermediate files often saves space and makes disk management easier.

Evaluating Flood-Prone Areas


This exercise is based on the notion that the ratio of Thematic Mapper bands 2 and 5 for land areas is extremely likely to be less than 1, and that the ratio of these two bands for water is extremely likely to be greater than or equal to 1. We can use this relationship as a very good index of water. Open a new Model Maker viewer and place 7 Raster objects, 4 Function objects, and 1 Conditional object, as shown in Figure 9. Connect them as shown. Define the first two Raster objects. The first (#1 in the figure) is PREFLOOD89.IMG. The second (#2 in the figure) is FLOOD93.IMG. Now define the first two Function objects. Your Function category is Conditional, and you will use the EITHER statement. Using the mouse as much as possible, create the following statement for the first function statement (A on the figure): Figure 9: Basic Layout of the Flood Model EITHER 0 IF ($n1_preflood89(5)==0) OR (FLOAT ($n1_preflood89(2)))/(FLOAT($n1_preflood89(5))) OTHERWISE This statement creates a raster whose value is 0 if the mid-infrared TM band 5 is background and which takes the value of the ratio if it is not background. The statement is worded as it is to insure [1] that you will not divide by zero and that [2] the division is done in floating-point math rather than integer math. Remember that division by zero cannot be done, and TM digital numbers are integers. If you did not state that they are to be treated as real numbers, the numbers to the right of the decimal point would not be evaluated. To define the second function statement (B on the figure), put in precisely the same statement except use image flood93 rather than preflood89. Define Raster objects 3 and 4 (#3 and #4 on the figure) as temporary rasters. Define the next two function statements (#C and #D on the figure) with the following statement: EITHER 2 IF (n3_memory < 1) or 3 OTHERWISE This will set the attribute value of 2 for land areas and 3 for water areas. Define Raster objects 5 and 6 (#5 and #6 on the figure) as temporary rasters. These are the estimates for land areas and water areas for the two TM images, one flooded and one not. Double-click on the Criteria graphic object. You will see two inputs as Available Layers. Click once on the first of these files in the list and then click on the Add Column button. A new column title is added to the first column in the editable field on the right. Click on the second memory input in the list and click the Add Column button to add a second column in the CellArray. Your CellArray should now have 1 row and two entry columns. Add two more rows with the Rows editable field. You can use the nudger to increase the value to 3. Enter the following values:

[pre-flood image] $n5_memory ==2 ==3 ==2

[flood image] $n6_memory ==2 ==3 ==3

Class 1 now represents areas showing up as land in both scenes. That is, it is normally land, and it was not flooded by the 1993 floods. Class 2 represents areas showing up as water in both scenes. It is normal river flow. Class 3 represents areas showing up as land in the pre-flood image and as water in the flood image. It is normally land, but it was flooded in 1993. Ensure that the All Criteria option is selected, and click OK. Define the output raster. Give it a name and ensure that it is on your X: drive. Select Delete if Exists, and change the Data Type to Unsigned 4-bit. The File Type changes automatically to Thematic. Click OK. Save the model and run it. View the resulting image. Select Raster-Attributes. Click the color patch of each class, and change it to display each class of land. Now from the Attribute Editor menu bar, select Edit-Add Class Names. This adds a new column in the CellArray. Give names to the areas such as [0] Background, [1] Non-flooded land, [2] Normal river flow, [3] Flooded areas. Save the image. Open two more viewers, and put the 1989 and 1993 images in the two new viewers. Link the first viewer (i.e. the one created by your model) with the two new viewers, so that you can see how the areas correspond to each other. Are you satisfied with this image? Does it clearly indicate which areas are really flooded? For example, might there be areas of forest whose canopies are above the water (so that they show up as land!), but whose lower trunks are flooded? Open a new Model Maker viewer. Place 3 Raster Graphic objects as inputs and one Raster graphic as output. Place a Function object between the inputs and the outputs, and place a Scalar object as an input to the function. Connect the 3 input Raster objects and the scalar objects to the Function object, and Connect the Function object to the output Raster object. Define the three input Raster objects. The first is QFOREST.IMG, an image showing forest distribution. The second is the flood image you just created with your first model. The third is QDEM.IMG, an elevation model for the region. Now define the Scalar object. Give it an Integer value of 149. This is the mean flood elevation of the scene. Now define the Function graphic object. Give it the following Conditional statement, assuming you called the output of your previous model Flood.img: CONDITIONAL {($n3_qdem < $4_Integer AND $n1_qforest EQ 1) 4, ($n2_flood) $n2_flood } Define the output raster with a suitable name on your X: drive. As before, select Delete if Exists, and set the Data Type to Unsigned 4 bit. Click OK. Save the model, and run it. Look at the results. Again, use the Raster Attribute editor to change the colors so that you can see them better. Add class names using Edit-Add Class Names on the menu bar, giving suitable names such as the following: [0] Background, [1] Non-flooded land, [2] Normal river flow, [3] Flooded areas, [4] Flooded forest. Again, compare the new model with the original TM images.

Imagine, now, that the river is rising, and that the Corps of Engineers has indicated that the flood crest within the next 24 hours will be 155 meters. How do you estimate the additional land that will be flooded? Return to the last model, in which you estimated the extent of flooded forest. Add three more Raster objects and two more Function objects, so that the output of the previous model is the input to the second Function object. The connections for the new objects should be as follows: the first new Raster object > the first new Function object > the second new Raster object > the second new Function object (to which the output of the previous model is also connected) > the third new Raster object. Define the first new Raster object as QDEM.IMG. Now define the first new Function object with the following EITHER statement: EITHER 1 IF ( $n7_qdem >= 149 AND $n7_qdem < 155) OR 2 OTHERWISE. This establishes the areas whose elevation means that they will be flooded within the next 24 hours (value = 1) and those whose status will not change (value = 2). Define the second Raster object as a Temporary Raster Only. Let us assume that this raster takes the name n9_memory. Now define the second Function object. Your Available Inputs are the output of your previous model and your DEM image showing areas between 149 and 155 meters. If your first output has the name n6_floodtrees, establish the following Function statement: EITHER 5 IF ($n9_memory == 1) OR $n6_floodtrees OTHERWISE Save the model, run it, and look at the results. Using the Raster Attribute Editor, change the colors appropriately, add a Class Names column, and give class names as before, adding class [5] as Next Flooded Areas. This image should be included in your portfolio for this unit. One final pass through the flood example. Take the models you generated in the previous sections and put them into a single large graphic model. You can do this by copying and pasting from one Model Maker viewer into another, just as you did with the Del Mar environmental planning example. In the process, you should either rename output files in the model so that they do not overwrite files you created earlier, or you should change them to temporary rasters. Examine your connections to insure that all are correct, and examine your Function statements to make sure that all of the file names have been changed correctly in the model. Ultimately, you should have only one primary output, which is the file produced by your previous pass. Let us assume that this file has taken the name NextArea.img. Now add a Matrix object to the model. Define the Matrix object. It is Built-in; the Kernel is Low-Pass, and the Size is 3x3. Add a Function Graphic object to the model. Connect the Matrix you just created to the new Function object, and connect the Raster object representing NextArea.img to it as well. Define the function. Click on the Functions: popup and choose Focal (scan) as the function group. Select FOCAL MAJORITY ( <raster>, <matrix> ) as the function to put into the Function Statement window. Enter the following statement: FOCAL MAJORITY ( $n11_nextarea, $n12_Low_Pass ) Finally, add an output Raster Graphic object. Connect the Focal Majority Function object to this new Raster object. Define it. Give it a suitable name on your X: drive, click on Delete if Exists, and change the output File Type to Unsigned 4-bit Thematic. Click OK. Save the model, run it, and view the output. Using the Raster Attribute editor, add suitable colors and class names to the file.

Questions to Consider 1. At several points in this exercise, you did things differently than you have in the past in this course. For example, at several points, you used a logical relationship (EITHER xxx IF yyy OR zzz OTHERWISE) instead of MASK. You used Focal Majority instead of a Low-Pass filter. Other than that the directions told you to do so, why did you do this (why would you do this; which would you do in the future)? How do you decide what function to use? If you were presented with a problem, how would you design a modeling approach that would most effectively give you the answer you want? Portfolio 1. The image of the environmental sensitivity analysis in Del Mar, California, superimposed over the SPOT imagery, with legend. The image of the various zones of flooding along the Missouri River.

2.

2.

Você também pode gostar