|
|
|
|
|
| GISc
Help Desk - Knowledge Base |
| The following
are some questions we commonly we receive concerning the
use of ESRI and Leica software products, as well as, entries
referenced from ESRI and Leica support directly. Please
give us feedback if you don't see an answer to your question. |
Browse
for Questions
> > > ArcToolbox 9.x |
|
|
 |
Why
was the Geoprocessing Wizard in ArcGIS 8.3 removed at
9.0? |
|
|
The
Geoprocessing Wizard is no longer available in ArcGIS
9.0.
The tools that were available in the wizard are still
available in our new Geoprocessing framework.
The wizard was removed because geoprocessing has
changed at ArcGIS 9. ArcGIS 9 introduces a large collection
of geoprocessing tools that may be used in a variety
of ways within any application. Tools may be used
to create geoprocessing workflows using ModelBuilder
and/or the scripting environment of your choice. Enhanced
dialogs, as well as a next generation command-line
interface may be used for executing tools. The ArcGIS
8.x Geoprocessing Wizard presented five operations
for map-based analysis. ArcGIS 9.0 ships hundreds
of tools, including the capabilities of the five operations
found in the 8.x wizard. Map-based analysis using
dialogs and the command line, as well as workflow
automation using models and scripts are now possible
with all tools. Geoprocessing at ArcGIS 9 is the same
for ArcView, ArcEditor, and ArcInfo; only the number
and capabilities of tools are different. The new geoprocessing
tools within the ArcGIS 9.0 framework are more flexible
and more powerful to use than the tools that were
presented in the ArcGIS 8.x Geoprocessing Wizard.
While this change will require you to alter how you
work with ArcGIS, the benefits of the new tools and
framework will quickly be evident.
Getting more information: The ArcGIS Help system
has detailed information regarding this change. Please
review the following topic:
What’s new in ArcGIS Desktop 9.0 > What’s
new in ArcMap: other changes in version 9.0 > What’s
new in ArcMap: Geoprocessing.
|
|
|
 |
Why
have the Merge capabilities of the ArcGIS 8.x Geoprocessing
Wizard been removed? |
|
|
I
used Merge in the ArcGIS 8.x Geoprocessing Wizard but
now, I cannot find the Merge function in the new Geoprocessing
framework.
The capabilities of the Merge option in the Geoprocessing
Wizard in ArcGIS 8.3 have been replaced by a combination
of several tools within the new Geoprocessing framework.
Merge used to combine a number of inputs into a new
feature class and it allowed the user to map fields
from the inputs to the output. In ArcGIS 9.0, the
Append tool is now used to merge data together. Append
will not create a new output dataset, as it is intended
for loading data into an existing dataset only. It
is, however, the only tool that will update a dataset
as all others create new data. The new workflow for
merging datasets, in ArcGIS 9.0, is to first create
a new feature class using the Create Feature Class
tool. This tool has options for taking input feature
classes that will define the schema and extent of
the new output feature class. Layers should then be
used to alter field names in the input feature classes
so fields from various inputs can be matched. Alternatively,
the Make Feature Layer tool may be used to create
a layer and set new field names or remove fields.
Breaking down the various components of appending
data together makes an operation more understandable
within the ModelBuilder and/or scripting environments.
ESRI determined that a geoprocessing tool that creates
and appends data as well as matches/alters fields
could be too confusing in the new environment. Allowing
people to use the tools previously described within
a model or script is seen as the best way of working.
Models and scripts may be modified to then fit other
data management workflows and documenting the process
will be easier. Getting more information: Please review
the Append functionality in the ArcGIS
Help System:
Geoprocessing (including ArcToolBox) > Data Management
Toolbox > General Toolset > Using the tools
> Append
|
|
|
 |
What
are the different ways to perform geoprocessing tasks
in ArcGIS 9? |
|
|
You
can perform geoprocessing tasks by running a tool via
its dialog box, at the command line, or within a script
or a model.
A dialog box is a form on which you supply the parameter
values for the tool, then click OK to run the tool.
This is the most familiar way of performing such tasks.
At the command line, you type the tool name and its
parameter values, then press Enter to run the tool.
Alternatively, you can create your own models inside,
or add scripts to, toolboxes. Models you create may
run a chain of tools in sequence, and scripts are useful
for batch processing multiple inputs, such as when converting
multiple datasets to a different format. Scripts can
be written in any COMcompliant scripting language, such
as Python, JScript, or VBScript, and they do not have
to be added to toolboxes. They can be run directly from
within the appropriate scripting application. |
|
|
 |
When
should you use a dialog box, command line, model, or
a script for geoprocessing tasks? |
|
|
When
should you use a dialog box?
Run a tool via its dialog box to become familiar with
the tool and its parameters. The dialog box helps you
provide valid parameter values and provides options
where appropriate.
When should you use the command line?
If you are familiar with the tool you want
to use and the parameter values that need to be supplied,
you may find the command line quicker and more convenient.
You can create variables to replace more complex
parameter values, such as a variable for the table
that reclassifies a raster, to help you to quickly
perform your geoprocessing tasks.
When should you build models?
Models automate the process of performing
a sequence of geoprocessing tasks on your data, so
build models when you want to perform multiple geoprocessing
tasks, such as clipping your data, unioning the results
together, then selecting areas from the unioned result
that meet a criteria.
You can quickly change parameter values for
tools in your model, then rerun the model to experiment
with different outcomes.
Build models when you need to present a work
flow to decision makers or the public.
When should you write a script?
Scripts let you execute simple processes that
include single tools, complex processes linked together,
or looping to perform batch processing on a set of
input datasets.
Scripts are recyclable, meaning they can be
data nonspecific and, therefore, used over and over
again. They can increase efficiency because they can
be executed at any time.
|
|
|
 |
All
the tools in the Toolbox are not listed or say they
are unavailable when I click on them. Why? |
|
|
The
system tools that are available for use depend on the
ArcGIS software product (ArcView, ArcEditor, or ArcInfo)
you are licensed to use. Extension products, such as
ArcGIS Spatial Analyst, give you access to even more
tools.
By default, in the ArcCatalog tree you will see all
tools, regardless of whether or not you are licensed
to use a particular tool. If you are not licensed to
use a tool, a lock icon will appear over the tool.
In the ArcToolbox window, you will not see the tools
that you are not licensed to use by default. If you
want to view these tools, right-click the ArcToolbox
window and click Show/Hide Locked Tools. Tools you are
not licensed to use will appear with a lock icon over
them. |
|
|
 |
Can
you customize ModelBuilder? |
|
|
No,
ModelBuilder cannot be customized. |
|
|
 |
Why
do the changes I made to my Toolbox not save after closing
ArcMap (or ArCatalog)? |
|
|
If
a toolbox is altered in one application, for instance,
in ArcMap, while another application is accessing it,
such as ArcCatalog, there is the possibility that changes
will be lost. When the last application is closed, it
will simply overwrite any changes that were made earlier.
When making changes to a toolbox, only one application
should be open at a time so this type of conflict is
avoided. Errors will not occur when a toolbox is accessed
by multiple applications, but the resulting toolbox
may not be what you expect.br
Rules for accessing a toolbox:
A toolbox is rewritten when a change has been completed.
Refresh the toolbox in other applications that are
accessing the same toolbox to refresh the contents
of the toolbox.
If multiple applications access a toolbox, the content
of the toolbox is determined by the last application
to be closed. Changes made to the toolbox in applications
closed earlier will be lost.
If two applications access a toolbox at the same
time, changes made in one application will not be
seen by the toolbox in the other application.
For example, if a toolbox is open in ArcCatalog and
ArcMap and a new tool is added in ArcCatalog, ArcMap
will not see the tool unless it reopens the toolbox.
Removing the toolbox from the ArcToolbox window in
ArcMap, then adding it back will refresh the toolbox’s
contents.
If a toolbox is accessed in two applications at
the same time, deleting the toolbox in one application
will not cause it to be deleted in the other.
For example, if a toolbox is open in ArcCatalog and
ArcMap and it is deleted in ArcCatalog, ArcMap will
still have access to it because it has already read
it into memory. When ArcMap is closed, it will rewrite
the toolbox, so instead of being deleted, a newer
version is created.
|
|
|
 |
How
do you repeat-run a geoprocessing tool-batch style processing? |
|
|
Users are able to use Model Builder in conjunction
with geoprocessing tools to create time saving tools
based on complex workflows. However, many users are
interested in running these tools or their own tools
over and over again, "batch" style. Scripting
gives users this functionality in ArcGIS. A variety
of scripting languages are supported in the geoprocessing
environment of ArcGIS 9.0, including Python, VBScript,
JScript, and Perl. In fact any scripting language
that is COM compliant can be used to create successful
geoprocessing scripts.
Scripting allows tools to be run again and again by
looping over the same section of code many times.
A good introduction to scripting in ArcGIS is the
"Writing Geoprocessing Scripts" digital
document found on the ArcGIS 9.0 "ESRI Software
Documentation Library" installation CD. In addition
to a good general introduction to the use of Python
scripting in ArcGIS, this document also dedicates
an entire chapter to "Batch Processing".
A sample script is provided below which shows you
how to clip all feature classes in a folder (workspace).
This script is described in detail on pages 12 to
19 in the aforementioned digital book. Help on Batch
Processing can also be found in the Desktop Help System
under: Geoprocessing > Writing Geoprocessing Scripts
> Batch Processing with geoprocessing scripts >
About Batch Processing with geoprocessing scripts.
While tracing through the script below there are a
number of important things to notice. First, the script
sets the workspace property of the geoprocessor object
to a path. This tells the geoprocessor object that
all data can be found in this location unless otherwise
stated. The script then calls the ListFeatureClasses
method, which returns a list of all the feature classes
in the workspace. This list can be stepped through
and various operations applied to the contents of
the list. To step through the list, the script uses
the ".next" method of the list in conjunction
with a "while" loop. The while loop says,
"While the position in the feature class list
(fc) contains something, execute the lines of code
in the loop". The code demonstrates the simple
formula for performing batch operations: Get a list
of the objects to which to apply operations, and use
a while loop to iterate over this list.
#Import standard library modules
import win32com.client, sys, os
#Create the Geoprocessor object
GP = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")
#Set the input workspace
GP.workspace = "C:/data/project"
#Set the clip featureclass
clipFeatures = "C:/data/project/StudyArea.shp"
#Set the output workspace
outWorkspace = "C:/data/project/clipped"
#Set the cluster tolerance
clusterTolerance = "1"
try:
#Get a list of the featureclasses in the input folder
fcs = GP.ListFeatureClasses()
#Loop through the list of feature classes
fcs.Reset()
fc = fcs.Next()
while fc:
#Validate the new feature class name for the output
workspace.
outFeatureClass = outWorkspace + "/" +
GP.ValidateTableName(fc, outWorkspace)
#Clip each feature class in the list with the clip
feature class.
#Do not clip the clipFeatures, it may be in the
same workspace.
if str(fc) != str(os.path.split(clipFeatures)[1]):
GP.clip_analysis(fc, clipFeatures, outFeatureClass,
clusterTolerance)
#Move to the next fc in the list.
fc = fcs.Next()
except:
print GP.GetMessages(2)
|
|
|
 |
How do you change
the Default Location of newly created Toolboxes and
Models? |
|
|
Instructions
provided describe how to change the default location
of newly created toolboxes and models. By default, when
a new toolbox or Model is created in ArcToolbox, either
via ArcCatalog or ArcMap, it is created in the User
Profile folder, C:\Documents and Settings\<User Profile>\Application
Data\ESRI\ArcToolbox\My Toolboxes.
Follow these steps in either ArcMap or ArcCatalog to
change the default location.
1. Select Tools > Options.
2. Select the Geoprocessing tab
3. Navigate to, or type in, the new location of the
'My Toolboxes' folder.
4. Click Ok.
|
|
|
 |
Why do
Toolboxes created in ArcMap or ArcCatalog not appear
in the ArcToolbox window? |
|
|
If
a toolbox in ArcMap or ArcCatalog is created within
the ArcToolbox Window, the next time the application
is opened, the toolbox is not listed.
This happes because the custom toolbox was not saved.
To workaround this right-click in empty space anywhere
within the toolbox and select Save Settings > To
Default.
This saves the toolbox reference to the default template;
the normal.mxt for ArcMap and the normal.gxt for ArcCatalog.
As an alternative, the toolbox settings, including any
custom toolboxes, can be saved to a file and loaded
on demand, instead of saving to the default template. |
|
|
 |
How
do you use AML scripts in the ArcGIS 9.0 Desktop environment? |
|
|
Instructions
provided describe how to use AMLs developed with older
ESRI software in the ArcGIS 9.0 Desktop environment.
There is an initial step which must be completed before
AMLs can be set up as a script tool. Please note: to
create script tools from AMLs you must have an ArcInfo
license.
Most systems do not recognize the program(s) that run
an .aml file. For an AML to be added as a script tool,
the system must know to open ArcInfo workstation and
run the '&run' command, such as arc: &run MyAml.aml.
ESRI provides a tool for updating the system registry
so that it knows what to do. After the tool is run,
use the 'Add Script Tool' wizards to add the AML as
a script tool.
AMLs that are run as script tools must be capable of
running from the “Arc” prompt. For example,
if the AML only runs in GRID, make sure to add a line
in the AML that starts GRID before running the rest
of the program.
Continue with the following steps:
- Browse to ...\\ArcGIS\ArcToolbox\Scripts.
- Find and double-click on the file called RegisterAmlAsExecutable.reg.
- When prompted about adding this information to
the registry, Click Yes.
- Create a new toolbox by right-clicking in the ArcToolbox
window and selecting 'New Toolbox'.
- Right-click on the toolbox created in the previous
step and select Add > Script. This starts the Add
Script wizard.
- Add Script Wizard:
Wizard Page 1: Name and describe the new script tool,
and click Next.
Wizard Page 2: Browse to the location of the AML
and click Next.
Wizard Page 3: Set up the input/output parameters
and options and click Finish.
For more help using the Add Script wizard, see the
online documentation at: > Geoprocessing > Geoprocessing
in the ArcGIS environment > Working with toolsets
and tools > Creating models and adding scripts.
|
|
|
 |
Bug:
Spatial Analyst tools don't provide a warning and allow
overwriting data |
|
|
** This issue is addressed in ArcGIS 9.0 Service
Pack 2 (SP2) **
Unlike the other geoprocessing tools, Spatial Analyst
tools are not providing a warning before allowing
you to overwrite existing data.
This is a known issue.
Workaround
** This issue will be addressed in ArcGIS 9.0 Service
Pack 2 (SP2) **
With this fix, the Spatial Analyst tools are now
consistent with the other geoprocessing tools and
provide a warning before overwriting data or error
out if the overwrite option is turned off.
|
|
|
 |
I
just created and edited a new feature class in my ArcMap
session, but now I can’t run any of my script
tools on this new feature class. Why not? |
|
|
While non-script core tools will work correctly,
all script tools including the Spatial Statistics
tools, Multi-ring Buffer, and any user created custom
tool will fail. This failure is not a result of errors
in the script(s) but rather a problem with the data
locking mechanism in ArcMap that is designed to prevent
concurrent use of a dataset.
The workaround is to save your map, close down the
current ArcMap session completely and then re-open
your map. Once ArcMap is re-opened, all script tools
will work correctly with the newly created feature
class.
|
|
|
 |
Bug:
Model Builder allows selecting a newly created output
location, but does not allow it to be used. |
|
|
If Windows Explorer is used to create a new directory
while creating a model, Model Builder will allow selecting
the folder for an output location, but will not allow
it to be used.
This is a known issue.
Workaround
Select one of the following workarounds.
* Use Windows Explorer to create the new directory
before creating the model.
* Create the new folder using ArcToolbox. Data Management
Tools > Workspace provides tools to create new
workspaces.
|
|
|
 |
How
do you append feature classes that have different schemas? |
|
|
Instructions provided are to append feature classes
that have different schemas. The Append function in
ArcToolbox > Data Management Tools > General
> Append does not append two or more like feature
classes of different schemas by default. It is necessary
to specify the schemas of all the feature classes
involved, in the new output feature class.
For this procedure, we have chosen to use shapefiles,
but any feature class (shapefile, personal geodatabase,
or SDE geodatabase) can be used. Create a new shapefile
that will store the output of the appended shapefiles.
Match the schema of this shapefile so that it matches
the schemas of the input shapefiles, by following
the steps below:
- Create a new shapefile using the Create Feature
Class tool. This tool allows you to specify that the
template of the new feature class will be a combination
of the shapefiles you are appending.
- Open Data Management Tools > General > Append.
Specify the input shapefiles that you are appending
into the new shapefile.
- Select the output feature. This is the shapefile
created in Step 1.
- Select NOTEST. This specifies that input schemas
are not to be transferred to the target feature class
unless they match the schema of the target.
|
|
|
|
|