lec06 geoprocessing framework

Upload: anamta

Post on 14-Jan-2016

225 views

Category:

Documents


0 download

DESCRIPTION

Geoprocessing

TRANSCRIPT

  • Geography 465Overview Geoprocessing in ArcGIS

  • Geoprocessing as modelingMODELING

  • Types of Models in GIS (by function)Descriptive models database Change models before and after Impact models what happens Explanatory models process influencePredictive models what will be likePrescriptive models should be like

  • Example of Suitability Model

  • The core of Geoprocessingbuilding data processing chains in GIS:

    data -> operation -> output

  • Geoprocessing Framework in ArcGIS 9.x Multiple ways to do geoprocessing in ArcGIS

  • Developing Geoprocessing Procedures with Model BuilderWhy use Model Builder?Automates geoprocessing workflow PortabilityExtensibility Reusability Documentation

  • Developing Geoprocessing Procedures (models) with Model Builder

    Identify the components of a model Build and test models Edit existing models Simplify complex models using submodels Set up a model to run from its dialogmodel parameterizationFacilitate conditional processing (branching) with scriptsCalibrate and validate

  • Model ComponentsIn ModelBuilder, models are represented as flow charts with distinct symbols for each type of component

    Elements are connected together via connector lines that serve to create processes as well as show processing flow

  • Model Components (elements)

    Data ToolDerived data Value Derived value

  • Data ProcessModels typically contain several processes, and they can be chained together so that the derived output from one process becomes the input for another process

  • VariablesAny element in a model that isn't a tool is a variable (project data, derived data, values, derived values)

    Variables can be thought of as placeholders for datasets or tool parameters

    Variable values can be easily changed, and they can be shared between processes in a model

  • Running a Model in ModelBuilder To run a model is to run all of the processes that compose it. The readiness of a process to run depends on the state of its elements. A process can be in one of three states:

    not ready to run, ready to run, or has been run.

  • Sources of Simple Errors in Models A model's readiness to run can be affected by various factors. One factor is connectivity. A tool that is not connected to an input element will not be ready to run. In this example, there is no input to the Buffer tool operation; therefore, it is not ready to run.

  • Sources of Simple Errors in ModelsAlthough the input data element is ready to run, the parameters of the Add Field tool have not been defined; therefore, the process as a whole is not Another factor affecting to ability to execute a process in ModelBuilder is specification.

  • Sources of Simple Errors in ModelsIn this example, the elements are connected and their parameters are fully specified. The problem is that ModelBuilder cannot find the input data it needs. The third factor affecting the ability to run a process is data accessibility.

  • How to start building a model?Identify functional relationships between the phenomenon and its variables Identify the initial input variablesIdentify the intermediate input variables.Choose appropriate tools for implementing transformation functions as processes Combine processes based on cause-effect relationships

  • Parametrizing Geoprocessing ModelsModel variables can serve as model parameters. There are two purposes for this: first, to be able to run your model from a dialog, and second, to be able to incorporate submodels.

  • Parametrizing Geoprocessing ModelsDeclaring a model variable as a parameter is called exposing the variable. Any variable in a model (in other words, datasets and tool values) may be exposed as a model parameter.

  • Running a model with parameters Right-click a data element to make it a parameter Input or output data can be parameters

  • Setting model properties Choose Properties on a models context menu

  • Setting model properties: General Modify the name, label, description, and style sheet

  • Setting model properties: Parameters Add, remove, or change the order of exposed parameters

  • Setting model properties: Environments Set values for all environments; applied to entire model

  • Models and SubmodelsUsing submodels allows you to divide parts of a larger model into smaller, more manageable pieces. Before a submodel can be added to a primary model, the output variable of the submodel must be exposed as a model parameter. This will allow the output variable to be shared between models.

  • Models and Submodels

  • Creating the ESRI Geoprocessor object three ways - from ArcGIS Desktop 9.3 help

  • three way comparison - from ArcGIS Desktop 9.3 help

  • Turning a Script into a ToolAnother way of using a submodel in a model is to:1) export the submodel into a script,2) turn script into a tool, and3) use a script tool in a model

  • Turning a Script into a Toolexport the submodel into a script

  • Script from previous export

  • Add a loop wrapper

  • Turning a Script into a ToolSteps: 1) expose inputs and the output as model parameters2) export the model into a Python script3) turn the script into a geoprocessing tool4) use the script tool as a submodel in an extended site suitability model

  • Geoprocessing Models as Simulation ToolsUsing a model as a simulation tool requires exposing the output data set as a model parameterDialogs provide a simplified view of a model and allow the user to easily change parameter values each time the model is run. Once these model parameters are set, model users can simply use the dialog for execution. Running a model from its dialog allows for easy testing of alternative scenarios.

  • Sequence Control and Conditional Processing in ModelBuilderYou can control the sequence of processing in your model by applying a precondition (the output data from one tool must exist before the tool can be executed)You can build conditional processing (branching) into your model with Python scripts Python Exercise time!