Introduction BASICS OF SPATIAL MODELER etraining Describes the Spatial Modeler workspace and functions and shows how to run Spatial Models. Software Data Spatial Modeler N/A Transcript 0:10 Thank you for watching this Hexagon Geospatial etraining module: Basics of Spatial Modeler. The Spatial Modeler is a powerful graphical modeling tool that lets you build your own geoprocesses. In this module you will see the Spatial Modeler used within ERDAS IMAGINE to get an understanding of the Spatial Model Editor and its basic components. 0:33 1. Starting with ERDAS IMAGINE open to the main workspace, from the File tab, select New, Spatial Model Editor. This opens the Spatial Model Editor workspace and the Spatial Modeler tab on the ribbon. Let s create a Spatial Modeler shortcut that enables you to open the Spatial Modeler quickly and easily. 2. From the Toolbox tab, select Spatial Model Editor. 3. Right-click Spatial Model Editor and select Add to Quick Access Toolbar. Now there s an entry on the Quick Access Toolbar which gives you rapid access to the Spatial Model Editor. 1:12 Spatial Modeler Layout Here is an example of an opened Spatial Modeler where spatial model operators have been placed in a logical sequence, so that you do not have to write complex image algebra formulae. The Spatial Modeler eliminates the need to create temporary raster files between distinct operations or functions within the geoprocessing flow. The Spatial Modeler also provides access to a real-time preview where you can see intermediate or final results without waiting for the data to be written to disk. This makes it very easy to investigate the effects of changing parameters of your Spatial Model or changing operations. 1
1:45 4 Green check marks or red crosses show whether you have constructed the Spatial Model correctly. The green check marks indicate that the model can run without issue. If the green check marks were red crosses, it would indicate an error within the workflow. In such a case you can activate a message panel which provides additional information on what might be causing a problem within the Spatial Model. In addition to raster-based functionality, the Spatial Modeler can access and process feature or vector geospatial information as well as provide Point Cloud manipulation, all of which can be combined in Spatial Models. Elements of the Spatial Modeler 2:19 The tab along the top provides access to the main Spatial Modeler functions. On the canvas, you can drag and drop operators and connect them to graphically construct a flow chart representing an executable model. You can add a Preview operator to the Spatial Model to display real-time results based on a pull architecture. This operator causes just the displayed spatial extent to be processed and shows the results in the Preview panel. Notice the Operators panel on the right. This is a list of predefined functions that you can connect into a workflow. When complete, your spatial model processes your data using your defined workflow. The Properties panel gives you access to the input and output ports of a selected operator, or, if you don t have an operator selected, this panel provides information on the Spatial Model. Spatial Modeler Tab 3:09 6 The Spatial Modeler tab shows several groups of functions. The Edit group includes standard editing tools such as cut, copy, paste, undo, and so forth. The Spatial Model Editor also supports standard keyboard shortcuts, such as Ctrl + A to select all operators in a model and the Delete key to remove selected operators from a model. The View group lets you show and hide some of the panels you saw earlier. The Execute group lets you run a Spatial Model in various ways. The Operator group provides capabilities to act on selected operators. The Model group lets you create submodels out of selected sets of operators to make Spatial Models easier to understand. You can also open the submodels for further editing. 7 The Share group provides two capabilities: one for protecting the intellectual property which might otherwise be exposed by a Spatial Model, and the other for quickly adding saved Spatial Models to a custom ribbon tab for easy access. The Show group provides tools for showing or hiding elements such as the background grid on the canvas. Finally, the Text Style group provides tools for annotating your Spatial Model to make it more understandable to others.
Drag and Drop Operators 40:2200 8 Now that you have an overview of the elements that make up Spatial Modeler, let s look at how to use them. The Spatial Model Editor provides a workspace for drawing, arranging, and executing a processing flow. Drag and drop operators from the Operators panel onto the canvas and connect the operators. This way, you can build a Spatial Model using operators such as Raster Input and Raster Output. You can add operators which process data from and to those end-point objects. In this example, you ll use a Relief operator. Connections between individual operators to define how information flows through the model can also be made. 9 You can connect the Raster Input operator to the Relief operator, and then connect the Relief operator to the Raster Output. This can be achieved by clicking and dragging from one operator to another using Ports, which we ll discuss later. Let s examine the results of the Spatial Model. 4. To do so, drag the Preview operator onto the canvas and connect the Relief operator to the Preview operator. 5. To watch the real-time results of this Spatial Model, click Preview. Input and Output Ports 50:3100 10 On each operator shown here using the Relief operator, ports define the parameters of the operator. Input ports perform tasks such as accepting input raster streams from the Raster Input, or setting parameters, such as the illumination elevation and azimuth for relief shading. Output ports usually pass information generated by an operator to another connected operator. In this example, the Relief operator passes information to the Preview operator. Some ports require values or information to be set, while others are optional. Ports shown as white accept a value which you set manually, or will use defaults that will successfully execute the operator. Required ports show as red and require either manual input or input from another operator. The operator is not fully defined and executable until you have values or connections on all red ports. Input Operators 60:2500 11 The basic building blocks of a Spatial Model include peach-colored end point operators which generally define the input and output data from the spatial model. As you have seen, these include Raster Inputs. In addition to Raster Inputs, there are other data sources such as Features, or vectors, like such as Shapefiles or GeoMedia Warehouses. You can also treat vector sources directly as rasterized inputs. You can also bring in nonspatial types of data such as matrices from a custom definition, library of pre-existing kernels, or files.
12 Tables, which can come from a Raster or Vector Input table or custom file sources, are also available as well as Scalars to define specific numeric values. When you want to build a Spatial Model you can distribute for others to use, you can use Port Inputs. The Port Inputs automatically prompt the user to define values used by your Spatial Model. See the Operators panel for the other Input operators you can use. Output Operator 70:2800 13 You can also set Output operators for a model. Raster Output operators let you define how the results of a model are handled, such as writing an image file to a disk. Operators You can output features, attributes attached back onto an image or vector features, tables of various types, matrices, and even text format reports if you need information generated by the Spatial Model. As mentioned before, you can send geospatial information to a Preview operator to see the model results in real-time. Port Output operators are also available. 80:060 14 We have mentioned operators and strictly speaking the peach-colored end point objects such as Raster Input and Raster Output are themselves operators. They still define an action to be performed. Properties For example, a Raster Input might define the action of taking a raster file on disk and converting that to raster blocks which can be operated upon by the rest of the Spatial Modeler processing flow. 15 As you have seen, you can drag these operators from the Operators panel and drop them onto the canvas. You can string operators together simply by dragging between their corresponding ports. The operators needed to build a Spatial Model are organized into functional categories within the Operators panel. To find a specific type of functionality, type into the search area at the top of the Operators panel. 6. Enter smooth and the list is limited to just those operators potentially applicable to smooth. 7. 16 To add an operator to the Favorites list, right-click the operator in the Operators panel and select Add to Favorites. This makes it easier to drag your frequently used operators into your Spatial Models. 8. To display help for an operator, right-click on the operator on the canvas and select Operator Help. 90:200 When you drag an operator onto the canvas, you can click on it and display its properties in the Properties panel.
The Properties panel shows information regarding the input and output ports provided by the particular operator. You can edit some ports. Notice that the Properties panel shows all available ports but the operator graphic on the canvas does not. The ports not shown are generally used less frequently, but you may use them in your particular processing. 90:4800 17 The Properties panel has five columns. Data Type The first is a Show column which indicates whether that particular port is displayed or hidden. If you want to show a port, click in the Show column of that port. You can connect other operators to any displayed port or you can manually enter values for the port in the Properties panel. You can enter values in the Properties panel for ports that are not displayed on the operator graphic. The second column in the Properties panel is the name of the port and is not editable. The third column is the Value for each port. You can directly enter values in the Value column. The fourth column shows the type of object that each port supports. For example, the Azimuth port used as part of the definition of the illumination source for relief shading is an ERDAS IMAGINE Double data type, meaning that it expects a double-precision, floating point number. The fifth column indicates whether each port s values are required or optional. Remember that white ports have a default value even if they are required and that red ports must have a value supported. 0:00 18 If the object or data type of a port is not obvious you can generally double-click on that port to show a dialog that lists the available valid values. You can also edit some values directly in the Properties panel. Adding Ports 110:090 You can add ports to some operators so you can increase the number of inputs or outputs to the operation. 9. For example, to use the Add operator to add three values (scalars, raster bands and so forth), you can right-click on the operator and select Add Port. Now you have three inputs to the addition process rather than two. 19 Similarly, the Conditional operator, which allows us to make a test and return a true or false result based on that test, can be modified to make multiple tests and return multiple results. Because the Conditional operator function needs a port for the test itself as well as a port to specify the value (or process) to be returned if that test is true, Add Port actually adds two ports each time.
Renaming an Operator 110:5600 20 You can rename operators. 10. Select the operator and click the Operator Info tab on the bottom right and enter the new name in the Display field. 11. You can also right-click on the operator on the canvas, select Rename, enter the new name and then click OK. Running a Model 120:2400 Once you complete your Spatial Model, you can run it on different sets of input data and review the results of the geoprocessing you designed. 12. 21 First, you can use a Preview operator by clicking on the Preview button on the Spatial Modeler tab. This processes just the data in the displayed spatial extent. You can even pan and zoom in the Preview view. You can update or modify your Spatial Model and immediately see the results of those changes. 13. Once your Spatial Model is complete, select the Run button in the Execute group to process the data to output results. 14. 22 Use the Run option to execute the Spatial Model and produce an output raster file on disk as specified by the design of the model. Use Run Just This which works in conjunction with selecting a subset of the Spatial Model operators. It will execute just that section so that you can quickly analyze the values and parameters being produced to see if they are correct and appropriate for running in the full model. You can also select an operator and click Run Just This to execute that operator and all the workflow before it that it depends on. 23 Use Run in Background to run the model without the visual feedback of the progress on the canvas, and instead as an independent background process. Run in Background runs in 64-bit, rather than being constrained to 32-bit processing by the editor. Use Run in Batch to send the execution of the model to batch processing at a later time or to perform parallel processing of the model on multiple sets of input datasets. You should now have a general understanding of the key elements necessary to create a Spatial Modeler. 140:0400 Thank you for watching this etraining module from Hexagon Geospatial. For more etraining, visit hexagongeospatial.com/etraining.