Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Spatial Analysis and Spatial Modeling

Similar presentations


Presentation on theme: "Introduction to Spatial Analysis and Spatial Modeling"— Presentation transcript:

1 Introduction to Spatial Analysis and Spatial Modeling
1 Introduction to Spatial Analysis and Spatial Modeling

2 Benefits of raster GIS ArcGIS raster support
The ArcGIS Spatial Analysis extention The seven interfaces Installation and licensing Exercise 1 Introduction to the interfaces

3 Benefits of raster GIS Location-based data model (cells)
Better than features for many types of analyses Especially sued for Surface creation and analysis Elevation, rainfall, population Location models Best site for business, hospital Distance measurement Proximity, mobility, best path Modeling movement Flood inundation, fire spread Modeling Distances Benefits of raster GIS Raster GIS views the landscape as a whole, rather than as a collection of discrete features. This provides many analytic advantages over vector GIS, some of which are listed below. Surfaces are unbounded geographic phenomena that vary continuously with location, like elevation and rainfall, and are difficult to model with vector features. In raster, each cell stores the surface value at its location. There are tools to derive slope, aspect, visibility, and other measures of a raster surface. • Location models weight and combine multiple raster datasets to help identi’ the places suitable for activities, like business, wilderness preserves, and so on. • Distances are measured from each cell to objects of interest, like roads, creating a surface of distance, as opposed to creating a single “buffer” polygon with a set radius around the objects. The distances may be weighted with other factors, like land value or terrain steepness, to help find least-cost paths or corridors for new freeways, animal migration routes, and so on. • Moving phenomena like fire, floods, oil slicks, and infectious diseases can be modeled with raster data—although these types of models can be very complex. • Uniform representation of point, line, and polygon features as cells permits these features to be easily combined in analysis. For example, you may combine a surface (elevation) with areas (ownership), lines (rivers), and points (wells) in the same analysis. Disadvantages of raster Raster does generalize landscape features to the selected cell size, which sacrifices their positional accuracy. Also, features become a collection of same-value cells and lose their uniqueness and topological relationships. The raster data model is therefore not well suited for engineering applications, inventories, or network analysis. Surfaces

4 ArcGIS raster support ArcGIS has out-of-the-box raster support
Use with ArcMap Draw, query, georeference Manage with ArcCatalog Copy, rename, delete, Manipulate with ArcToolbox Convert, project, merge, clip, Store with a geodatabase Raster datasets and catalogs Add Spatial Analyst for analysis ArcGIS raster support The ArcGIS product provides substantial raster support without the Spatial Analyst. ArcMap, ArcCatalog, ArcToolbox, and the geodatabase all have raster capabilities. • ArcMap draws raster data and provides controls for classifying the data and assigning appropriate symbology. Cells may be selected with attribute queries. Rasters are projected on- the-fly, like vector data, to match the display projection, and there are tools for georeferencing raster data. • ArcCatalog manages raster datasets, providing standard copy, rename, and delete capabilities. Additionally, ArcCatalog has tools to convert between raster formats, to load rasters into a geodatabase, and to enhance rasters with ancillary data, like cell value statistics. ArcToolbox manipulates raster datasets. It has tools for merging, clipping, and projecting raster datasets. It also has a selection of tools for converting between raster formats and for converting vector to raster or raster to vector. • A geodatabase can store both individual raster datasets and raster catalogs (which are useful for large imagery archives). An ArcSDE geodatabase stores the rasters themselves inside the relational database. However, a personal geodatabase has limited storage capacity and only stores references to file-based rasters but still provides a consistent data management environment for vector and raster GIS data. Spatial Analyst adds analytic capabilities The Spatial Analyst extension adds a library of over a hundred analytic tools that may be used to extract information from raster data.

5 Spatial Analysis tools
Over 100 tools organized into toolsets Spatial Analyst tools The Spatial Analyst extension is a library of well over 100 raster processing tools, organized into toolsets based on common functionality. Many tools create outputs that are immediately useful, like creating shaded relief from a raster of elevation data. But the real power of Spatial Analyst lies in using the tools together to perform complex tasks, like finding locations suitable for building a power plant, identifying groundwater recharge areas that should be protected, or defining the best route for a proposed highway. Most of this class provides instruction on using the tools and understanding the concepts behind them, so we will not attempt to review all of them here. The ArcToolbox The graphic above shows the ArcToolbox, which is one of seven different ways of using the Spatial Analyst tools. It conveniently organizes the tools into functional groups (toolsets), and the graphic provides an appropriate overview of the scope of the Spatial Analyst. Raster data The Spatial Analyst tools work with any ArcGIS-supported raster format. These include: ESRI grid, BMP, MrSID, BIL, BIP, BSQ, GIF, PNG, TIFF, ERDAS Imagine, LAN, GIS, Raw, JFIF (JPEG), ER Mapper (standard format, not ECW), DTED Levels 1 and 2, ADRG, CADRG, CIB, NITF, and others. Refer to the ArcGIS Desktop Help for a complete list of supported image formats and their technical specifications (bit depth, color map support, single and multi-band, and so on).

6 Seven interfaces for Spatial Analyst
1. ArcToolbox Dialogs for all tools 2. Command Line Type commands 3. Model Builder Visual modeling 4. Scripts Write easy programs 5. Spatial Analyst Toolbar Dialogs for common tools 6. ArcObjects More programming power 7. Map Algebra Tools For all interfaces Most become Map Algebra Evaluated by Raster Engine ArcToolbox Command Line Model Builder Map Algebra Scripts Raster Engine ArcToolbox ArcObjects Seven ways to use Spatial Analyst As mentioned earlier, the Spatial Analyst extension is a library of raster processing tools. The tools have seven different interfaces, as shown above. For example, you may use the Slope tool in the ArcToolbox, where it has a dialog interface, or in the Command Line, where you type the tool name and its parameters. Each of the seven interfaces is described in the following pages. Map Algebra and the Raster Engine No matter which interface you use to run a Spatial Analyst tool, internally it is translated into a Map Algebra expression (described later), which is in turn submitted to the Raster Engine for evaluation. That is, a given Spatial Analyst tool runs the same program regardless of its interface. Other non-Spatial Analyst ArcGIS geoprocessing tools do not behave this way. Note: A few Spatial Analyst tools are not translated into Map Algebra but this has no impact on how you use them. The geoprocessing framework The geoprocessing framework provides an integrated software environment for the ArcGIS tools and permits the same tool to be used in the ArcToolbox, the Model Builder, the Command Line,and in scripts. An important characteristic of the geoprocessing environment is that its environment settings (e.g., the output cell size) are shared between all tools that were built within the framework. Map Algebra Tools

7 The Spatial Analyst toolbar
Dialogs for commonly used tools Can compose Map Algebra expressions The Spatial Analyst toolbar The Spatial Analyst toolbar can be added to the ArcMap interface. It implements dozens of the most commonly used Spatial Analyst tools, providing dialog interfaces for them. The toolbar can be opened in a variety of ways. One method is to right-click on the ArcMap menu bar and click the toolbar name in the context menu that appears. You open the tool dialogs by clicking the Spatial Analyst pulldown control on the toolbar, then navigate to a tool category, and click a tool. You fill in the dialog and click OK to run the tool. The Raster Calculator This tool is used to compose Map Algebra expressions. Although Map Algebra tools exist in all environments, the Raster Calculator is one of the easiest to use. The geoprocessing framework The Spatial Analyst toolbar predates the geoprocessing framework, which was released with version 9 of ArcGIS. An important implication is that the Spatial Analyst toolbar has its own processing environment (like output cell size, raster extent, and so forth), which is not shared with the ArcToolbox, Model Builder, Command Line, or scripts. Has its own environment (not part of the geoprocessing)

8 Spatial Analyst and ArcToolbox
Opens ArcToolbox Spatial Analyst and the ArcToolbox The ArcToolbox exposes all the ArcGIS geoprocessing tools as dialogs. To use a tool, you navigate to it (or use the search tools to find it), double-click the tool name to open the dialog, fill in the fields, and click OK to run the tool. Using ArcToolbox Tools may be accessed either through the ArcCatalog tree, where the ArcToolbox appears as folder toward the bottom of the tree, or as a separate dockable window in ArcCatalog, ArcMap, and other ArcGIS applications. Extensions, like Spatial Analyst, appear as toolboxes. You may add your own toolboxes and toolsets to organize your tools. You may copy and paste existing tools between toolboxes and/or toolsets. And, you may add your own models, scripts, and system tools to the ArcToolbox as tools. (Right-click in the ArcToolbox or on toolboxes and toolsets to raise context menus with various management options). Sharing your tools You can share your customized toolboxes with other users. Your toolboxes are stored as .tbx files in your system Documents and Settings folder, which you may distribute as you wish. Read the topic Sharing your geoprocessing work in the ArcGIS Desktop Help for details on setting up a toolbox for sharing. Hints and links to help Uses geoprocessing environments (right-click to set) Has Map Algebra tools

9 Spatial Analyst and Command Line
Opens the Command line Command Interface for tools Spatial Analyst and the Command Line The Command Line window may be used to run any geoprocessing tool even those you have written and added to the ArcToolbox. You type the tool’s command name and parameters and then execute the tool when you press Enter, or you may drag and drop a tool from ArcToolbox into the Command Line window, which is a quick way to discover a tool’s command name (tool names and command names are usually different). The Command Line window You open the Command Line window in either ArcCatalog or ArcMap by clicking its button on the Standard toolbar. The Command Line window contains two sections: a command input line and a message section. You type a geoprocessing command and its parameters in the input line. Messages are displayed as the command runs. Using the Command Line window The Command Line window has several convenient features. You may: • Obtain a list of available tools and environment settings. • View the syntax for tools to see the parameters that you must specify, and in some cases, choose appropriate parameter values from pulldown lists (this is code completion). • Set values for environment settings. • Create variables for parameter values that you may save and reuse. • View the messages from previously ran tools. • Open the dialog for a previously ran tool, edit its parameters, and rerun it. Shows Processing Supports code completion

10 Spatial Analyst and Model Builder
Drag tools Drag data Spatial Analyst and the Model Builder Building a model helps you to automate and manage a geoprocessing work flow. A complex model may contain a number of interrelated processes. With the Model Builder, you may change existing models (e.g., to replace old datasets with newer ones, to change environments, to add processes, to delete processes, or to change tool parameters). Using the Model Builder You open the Model Builder window either by adding a new model to the ArcToolbox (right- click in a toolbox) or by editing an existing model (right-click on a model in the ArcToolbox). You add tools — including other models and scripts — to the model by dragging and dropping them from the ArcToolbox onto the open Model Builder window. In order to set a tool’s parameters, you open its dialog by double-clicking the tool icon in the window. You add data to the model in several ways, like by dragging from either ArcCatalog, from the ArcMap Table of Contents, or by setting input/output parameters in a tool dialog. You use the Model Builder toolbar for a variety of tasks, including setting the model properties and parameters, controlling the model layout and symbology, and running the model. You may run a model by double- clicking it in ArcToolbox. Exporting models to scripts In the Model Builder window, click Model > Export> To Script to export your model to Python, JavaScript, or VB script. In addition to many other uses, this is a wonderful way to learn how to write geoprocessing scripts in these languages. Click tools to set parameters Set model and diagram properties Save and run model Edit and change Uses geoprocessing environment Add a new toolbox Add a new model

11 Spatial Analyst and scripts
Many languages are supported (Python shown) Is object-oriented (But easy!) Uses geoprocessor tools, environments May add scripts to ArcToolbox May use scripts in models Has a Map Algebra tool Spatial Analyst and scripts Scripts can automate simple or complex tasks using any of the ArcGIS geoprocessing tools and can be written so that they are data independent so they may be reused. You may add your scripts to the ArcToolbox, where they are used like any other tool. Writing scripts is easy, and you should have no trouble mastering the simple skills you need to get started. Supported scripting languages You will probably write geoprocessing scripts using one of the popular languages, like Python, VB Script, JScript, or Perl although any language that is COM compliant and implements the IDispatch interface is supported. Scripts are usually text files, although some languages can compile scripts into binary executables. Python ESRI provides script samples in Python because it is easy to learn, has the capabilities of a complete developer language, has a convenient development environment (PythonWin), and can run on many platforms including UNIX, Linux, and Windows. And, it is free. In fact, several of the tools in the ArcToolbox are actually Python scripts. For more information, visit on the Web. How it works An ArcObject called the geoprocessor provides a single access point and environment for the execution of any of the more than 400 ArcGIS geoprocessing tools, including extensions. In the example above, these lines create the geoprocessor object and use it to run the Slope command: Gp wirl3200m.client.Dispatch(”esriGeoprocessirig.GpDispatch.l”) Gp.Slopesa(IriElev, OutSip, “DEGREE”, “1”)

12 Spatial Analyst and ArcObjects
Many languages are supported (VBA shown) Is object-oriented (Powerful, but a lot of classes to learn) Must set your environments Build stand-alone applications, or build tools, or ...? Has classes for Map Algebra Spatial Analyst and the ArcObjects All of the ArcGIS applications (like ArcMap) and tools (like Slope) are built using a collection software components called the ArcObjects. For example, the Slope tool is really a program that invokes the Slope method on the ISurfaceOp interface of the RasterSurfaceOp object. Of course, the tool program does other work as well, like validating the input and output data sets. Supported programming languages The ArcObjects technology is based on the Component Object Model (COM), and the objects may be used in any COM-compliant programming language such as Visual Basic, Visual C , or Delphi. In these environments, developers have access to all the same components that ESRI used to build ArcGIS. They can use the ArcObjects to build new tools in the existing ArcGIS applications, to extend the ArcGIS data model, to embed ArcGIS capabilities into other applications (like into Microsoft Word), or even to build complete stand-alone applications. Additionally, the ArcObjects may be used in Visual Basic for Applications (VBA) to write sophisticated applications that run inside ArcGIS applications like ArcCatalog or ArcMap (both have the VBA editor built into them). VBA does not support all the features found in the other languages mentioned above, like the ability to compile a program. Programming vs. scripting Programming directly with the ArcObjects is somewhat more difficult than writing scripts with the geoprocessor object because you must write all the code to create the objects, access the appropriate interfaces on them, set all the necessary environments, and so on. For example, the program shown above uses 50 lines of code to do the same work that the script on the previous page does with 20. Since there are several thousand ArcObjects classes, it takes longer to learn to program with them than to learn to program with the several hundred commands found on the geoprocessing object.

13 Spatial Analyst and Map Algebra
An analysis language for raster data Uses math-like expressions with operators and functions: SmoothHill = Hillshade(FocalMean([Elevation) * )) Can be more efficient than Spatial Analyst tools (one expression may use many functions and operators) Spatial Analyst tools and Map Algebra Most tools implement Map Algebra functions and operators Tools provide dialog and command line interfaces Most tools implement a single function or operator (some implement many functions) Tools exist for writing Map Algebra expressions Spatial Analyst and Map Algebra In a sense, Map Algebra is the ArcGIS Spatial Analyst product. It is a language made up of operators, functions, and rules for manipulating raster data. By combining its operators and functions in creative ways, you can perform surprisingly sophisticated analysis of your data. Map Algebra and Spatial Analyst tools The Spatial Analyst tools typically provide an interface for a single Map Algebra operator or function, like Hillshade. A few implement multiple functions, like the Focal Statistics tool which implements ten different Focal functions. A few obscure functions (like Color2Hue) have no corresponding tool; these can only be used in Map Algebra expressions. Writing Map Algebra Each of the seven Spatial Analyst interfaces provides tools for writing Map Algebra. For example, in the Spatial Analyst Toolbar you use the Raster Calculator. In the ArcToolbox you use either the Single Output Map Algebra tool or the Multi-Output Map Algebra tool. The advantage of Map Algebra Map Algebra can be much more efficient and powerful than simply executing a function or operator with a tool because you can nest functions and string them together with operators. The example at the top of the page shows a compound Map Algebra expression. The expression starts by multiplying each cell in [Elevation] by to convert the values from feet to meters, then passes the result to the FocalMean function to smooth the surface, and then passes that result to the Hillshade function to calculate sun exposure for each cell. The result is a single raster (SmoothHill), which you may draw to create a map of shaded relief. Map Algebra is somewhat harder to use than the tools, since you must type the expressions and there is little or no “hinting’ to help you with the syntax.

14 Managing the extension
Extensions provide you with additional GIS functionality. Most are optional products that are registered or licensed individually. To ‘unlock’ an extension that has been installed, you must register it (if you are using the Arc View or ArcEditor ‘single use’ product) or license it (if you are using the ArcView, ArcEditor or Arclnfo ‘floating’ product). You enable a license with the Extensions dialog and check license availability with the Desktop Administrator. Extensions dialog Open this dialog in ArcMap and ArcCatalog by clicking Tools on the menu bar and then clicking the Extensions option. The dialog only shows extensions that work in the application (i.e., ArcMap only shows extensions that work in ArcMap). All installed extensions are listed, regardless of whether they are registered or whether licenses are available for them. Extensions must be enabled before they may be used. To enable a licensed extension, check the box next to it. To disable an extension, either Un- check the box or quit the application. Disabling an extension makes it available to other users. Desktop Administrator Open this dialog by clicking Windows Start > Programs > ArcGIS > Desktop Administrator. The application may be used to check the availability of licenses for the installed extension products as shown in the graphic above. It may also be used to change to a lower-level floating product (i.e., you can switch from floating ArcEditor to floating Arc View if you wish), to change to a different license manager, or to view information about your ArcGIS installation. Tools > Extensions • Enable or disable extensions Start> Programs > ArcGlS> Desktop Administrator • Select software product • Select license manager • Check license availability

15 Resources for self study
Online Help For ArcGIS Desktop users and for developers Documentation ESRI Support Center Software information Knowledge Base Downloads User forums Developer support and tools Virtual Campus courses Self-learning modules Online Help The ArcGIS Desktop Help provides theoretical discussions for the Spatial Analyst tools, as well as instruction in their use. The Developer Help details the ArcObjects classes that implement the Spatial Analyst and provides sample code. Documentation Several books come with the software, like Using ArcGIS Spatial Analyst by Jill McCoy and Kevin Johnston. Online Support Center Accessible via the Internet at the ESRI Support Center provides a wealth of information about ESRI software products and GIS technology: • Software: Information on system requirements, technical articles, and so on • Knowledge Base: Database of known bugs, ‘How to” documents, white papers, and so on • Downloads: Software updates, patches, ArcScripts, data models, and developer samples • User Forums: Exchange information with other ESRI product users • For Developers: Sample code, technical documents, object model diagrams, and so on Virtual Campus courses Take self-paced training modules from ArcObjects Online Get programming support from

16 Exercise 2 overview Check the license in the Desktop Administrator
Enable the extension in ArcMap Run a tool with the Spatial Analyst toolbar Run a tool with the ArcToolbox Run a tool with the Command Line window Build and run a model with the Model Builder Create and run a script and view its code Run and view a VBA program that uses ArcObjects Write and run a Map Algebra expression Install several ArcObjects-based utilities (you will use them in future exercises) Exercise 2 overview The focus of the exercise is to familiarize you with the various interfaces for the ArcGIS Spatial Analyst. You will run several tools using the Spatial Analyst toolbar, the ArcToolbox, the Model Builder, and so on. The exercise provides very little information about the tools you will use — they will all be covered in detail in later lessons. You will start the exercise by using the Desktop Administrator application to check the availability of Spatial Analyst licenses and by enabling the Spatial Analyst extension using the Extension dialog in ArcMap. In the last step, you will install several utilities that you will use on and off throughout the class. The Copy/Paste Raster Symbology utility was written especially for the class. The Cell Tools utility is distributed as part of the ArcObjects Developer Kit as a sample.


Download ppt "Introduction to Spatial Analysis and Spatial Modeling"

Similar presentations


Ads by Google