There are some fundamental differences between geoprocessing performed in ArcGIS version 9.2 and 9.3. While I will not cover them all in this post, I will attempt to show the most fundamental differences that people seem to encounter more often.
The fundamental differences are as follows:
- The method of invoking the geoprocessor is very similar for both, with the exception of an optional parameters when creating the object.
- Geoprocessing methods do not return Python built-in data types but rather ESRI iterable objects.
- Methods that used to return True/False values now return the Python True or False object rather than a string or 0/1.
The following table illustrates the differences:
| ArcGIS version 9.2 | ArcGIS version 9.3 |
|---|---|
gp = arcgisscripting.create() |
gp = arcgisscripting.create(9.3) |
# Create a list of available feature classes
fcs = gp.ListFeatureClasses()
# Iterate through said feature classes
fcs.Reset()
fc = fcs.Next()
while fc:
# Do work here
fc = fcs.Next()
|
# Create a list of available feature classes
fcs = gp.ListFeatureClasses()
# Iterate through said feature classes
for fc in fcs:
# Do work here
|
# Identify the fields of a feature class
dsc = gp.describe(fc)
# Get the fields from the description
flds = dsc.Fields
# Iterate through the fields
flds.Reset()
field = flds.Next()
while field:
# Do work here
field = flds.Next()
|
# Identify the files of a feature class
dsc = gp.describe(fc)
# Get the fields from the description
flds = dsc.Fields
# Iterate through the fields
for field in flds:
# Do work here
|
# Tell the geoprocessor to overwrite output by default. gp.OverWriteOutput = 1 |
# Tell the geoprocessor to overwrite output by default gp.OverWriteOutput = True |
There is not list of commands that need the changes to the best of my knowledge. But a quick look through the Geoprocessor Programming Model for ArcGIS 9.2 can show which methods return an enumeration unit. In brief, ListDatasets, ListFeatureClasses, ListRasters, ListTables, ListWorkspaces, ListEnvironments, ListToolboxes, ListTools and all other methods that return an Array Object. For a complete listing of the changes, please read the ESRI document for Geoprocessor changes in 9.3.
Related posts:

(2 votes, average: 4.50 out of 5)
[...] wrong with the gp.OverWriteOutput statement, and found that there are indeed differences between ArcGIS geoprocessing 9.2 and 9.3 with this statement. But specifying 9.3 (gp = arcgisscripting.create(9.3) didn’t change [...]
[...] I understand from Michalis Avraam’s page here (where I saw the above code samples) that as of version 9.3, the way to go is the Pythonic one. [...]