geoprocessing in arcgis issues • geoprocessing often involves areas or lengths, so using a...
TRANSCRIPT
5/1/2017
1
Chapter 10
Geoprocessing
(Continued)
Copyright © McGraw-Hill Education. Permission required for reproduction or display.
10-1
Geoprocessing in ArcGIS
Copyright © 2015 by Maribeth H. Price
10-2
5/1/2017
2
Geoprocessing• Executing analysis functions and tools
• Stringing together analysis functions to achieve a result
Copyright © 2015 by Maribeth H. Price
10-3
Geoprocessing Environment
• Familiar ways to execute functions– Menus and toolbars
– ArcToolbox
• Environment settings
• New ways to execute functions– Command line
– Creating new tools with ModelBuilder
– Writing scripts
Copyright © 2015 by Maribeth H. Price
10-4
5/1/2017
3
Menus and Toolbars
• Quick access to common functions
• Organized by topic
• Turn off and on as needed
• Customizable
• Many different toolbars and menus available
Copyright © 2015 by Maribeth H. Price
10-5
…..More!
ArcToolbox features
• Hundreds of functions organized into toolsets
• Expandable by purchasing extensions.
• Runs in ArcMap or ArcCatalog
• Many functions in the toolbox are not accessible from the menus and toolbars.
• Create custom toolsets with your favorite tools
• Create your own tools
Copyright © 2015 by Maribeth H. Price
10-6
5/1/2017
4
Environment Settings
• Environment Settings affect the output of tools and commands
• Set at application level or when running a tool
• Application level settings are saved with map documents
Copyright © 2015 by Maribeth H. Price
10-7
Setting Environment Settings
Copyright © 2015 by Maribeth H. Price
10-8
Application level settings affect all tools and menus
Tool settings affect one execution of one tool
5/1/2017
5
Some useful settings
• Current and scratch workspace
• Output coordinate systems
• Processing tolerances
Copyright © 2015 by Maribeth H. Price
10-9
Use sparingly at first, and experiment with tool settings until you gain experience.
The XY tolerance
• Feature class property set at time it is created
• Minimum allowed distance between two vertices
• Used to cluster nearby vertices during geometry operations such as clip, intersect, etc.
• Default setting intended to preserve accuracy
Copyright © 2015 by Maribeth H. Price
10-10
0.001 meter0.003281 feet0.0000000556 degrees
gap
overlap
ac
b
Clustering
5/1/2017
6
Using tolerances
Copyright © 2015 by Maribeth H. Price
10-11
You can increase the XY Tolerance during geoprocessing to help eliminate slivers.
Value must be carefully chosen.
Affects the output only.
Effect of tolerances
Copyright © 2015 by Maribeth H. Price
10-121500 m1000 m
Default 500 m
Union performed on districts and counties using different tolerance settings
5/1/2017
7
Coordinate Systems and Geoprocessing
Issues• Geoprocessing often involves
areas or lengths, so using a projected coordinate system is usually required for best results.
• If not otherwise defined, the output CS defaults to the first data set input to the tool.
• Reprojections will be done during processing if needed, but it is better to control if they are done.
• A good analyst is always aware of the coordinate systems being used during processing.
Best Practices for Analysis• When developing a project,
choose a coordinate system, instead leaving data in a GCS or a chance mixture.
• Select a projection with minimal distortion for the study region.
• Convert all data sets to the same coordinate system (see Chapter 11) before doing any analysis.
• Ensure that the data frame is always set to the same CS as the data it contains.
Copyright © 2015 by Maribeth H. Price
10-13
Background Processing
• Introduced in ArcGIS 10
• Allows you to continue working while a geoprocessing tool runs
• It is on by default
• Runs slower for short tasks but good for long ones
• Potential for file conflicts
• Author recommends turning it off
Copyright © 2015 by Maribeth H. Price
10-14
Completion notification boxes:
Background processing
Foreground processing
5/1/2017
8
Geoprocessing options
Copyright © 2015 by Maribeth H. Price
10-15
Turn off background processing here
Recently used tools
Using a tool
Copyright © 2015 by Maribeth H. Price
10-16Access info and Help
Error tips
Double-click
5/1/2017
9
Searching for tools
• Search window
• Find tools based on name or keyword
Copyright © 2015 by Maribeth H. Price
10-17
See where tool lives
Click to open tool
Hover for description
Some analysis tools
Copyright © 2015 by Maribeth H. Price
10-18
5/1/2017
10
The Intersect tool
Copyright © 2015 by Maribeth H. Price
10-19
Dissolving
Copyright © 2015 by Maribeth H. Price
10-20
Choose to summarize
other attributes
One attribute preserved in
output
5/1/2017
11
The Buffer tool
Copyright © 2015 by Maribeth H. Price
10-21
NONE option ALL option
Careful! The default Dissolve option on this tool is often NOT the best choice.
Lengths and areas of features
Copyright © 2015 by Maribeth H. Price
10-22
5/1/2017
12
Areas and lengths
• Areas or lengths are important
– Total length of streams in each watershed?
– Total snail habitat area?
• Often tools change areas or lengths of features
Copyright © 2015 by Maribeth H. Price
10-23Before After
Dissolve
Remember• Geodatabase Shape_Area and Shape_Length fields
are automatically updated.– Other fields may contain areas or lengths which are NOT
• Shapefiles do NOT update any area or length fields automatically.
Copyright © 2015 by Maribeth H. Price
10-24
5/1/2017
13
Updating lengths and areas
• After performing operations than can change geometry, such as clip or intersect, recalculate any user-defined length or area fields.
Copyright © 2015 by Maribeth H. Price
10-25
Model Builder
Copyright © 2015 by Maribeth H. Price
10-26
5/1/2017
14
Geoprocessing• Executing analysis functions and tools
• Stringing together analysis functions to achieve a result
Copyright © 2015 by Maribeth H. Price
10-27
ModelBuilder
• Create models built from sequences of tools
• Store processing steps for later reference
• Execute models repeatedly with different inputs
• Share models with others
Copyright © 2015 by Maribeth H. Price
10-28
5/1/2017
15
Building models
Copyright © 2015 by Maribeth H. Price
10-29
1. Open new model
2. Drag and drop a tool from the toolbox to the model.
3. Open the tool and enter the parameters. 5. Done. Add another step if
needed
4. Run the model step
Creating a new toolbox
Copyright © 2015 by Maribeth H. Price
10-30
Toolboxes may be created in folders, geodatabases, or in other toolboxes.
Name toolbox
5/1/2017
16
Add toolbox to ArcToolbox
Copyright © 2015 by Maribeth H. Price
10-31
Although accessible from the Catalog, it is convenient to place the new toolbox in ArcToolbox.
Creating a model
Copyright © 2015 by Maribeth H. Price
10-32
1. Create new model
2. Open Model Properties
3. Set Model Properties
5/1/2017
17
Adding tools to model
Copyright © 2015 by Maribeth H. Price
10-33
1. Drag ‘n’ drop tool to model
2. Right-click to open tool properties
Manage model layout
Set tool arguments
Copyright © 2015 by Maribeth H. Price
10-34
Colors indicate that tool is ready to run.
input tool output
Run
Shadow indicates the step has been run.
5/1/2017
18
Set Intersect arguments
Copyright © 2015 by Maribeth H. Price
10-35
Select blue icons to ensure chain
of inputs , outputs
Set Intersect(2) arguments
Copyright © 2015 by Maribeth H. Price
10-36
5/1/2017
19
Set output properties
Copyright © 2015 by Maribeth H. Price
10-37
Add to Display puts the output in the Table of Contents for viewing.
Intermediate indicates that the output is temporary. It will be deleted after tool completes running.
Model ready to run
Copyright © 2015 by Maribeth H. Price
10-38
5/1/2017
20
Examine Output
Copyright © 2015 by Maribeth H. Price
10-39
Shadows indicate model has run.
Running it again
• Tools > Options > Geoprocessing– Set ArcMap to
overwrite existing datasets
Copyright © 2015 by Maribeth H. Price
10-40
5/1/2017
21
Run a model as a tool
Copyright © 2015 by Maribeth H. Price
10-41
Setting an input to a parameter lets the user enter a value each time it is run.
Run as tool
Open canvas and edit
Parameters from tool arguments
Copyright © 2015 by Maribeth H. Price
10-42
5/1/2017
22
Models and Scripts
• Models can be converted to scripts (programs)
• Scripts can be written and edited separately from models
• Scripts can include looping, if-then control etc.
• Choose from several languages
• Python is used by ESRI for examples
• Another way to create your own tools
Copyright © 2015 by Maribeth H. Price
10-43