Geoprocessing is built around the concept of data types. Every tool parameter and every model and command line variable has an associated data type, which describes the contents of the variable. Some simple data types are string (any set of alphanumeric characters), boolean (a true/false value), and long (an integer value between -231 and 231). In addition to these simple data types, there are dozens of other data types built specifically for data found in ArcGIS, such as Coordinate System and Extent.
Casual geoprocessing users don't have a need to know about data types. But there are three situations where you are asked to provide data types for variables and parameters.
- In ModelBuilder, when you create a stand-alone variable, you need to provide a data type for the variable to be created.
- In Command Line, when you create a variable with the Variable Manager, you need to provide a data type for the variable to be created.
- When adding a script tool, you need to provide the data type for each of the script tool's parameters.
In the case of ModelBuilder and Command Line, many users create variables from a parameter. Since all parameters have an associated data type, the variable is automatically created with the correct data type.
Learn how to create a variable from a parameter in ModelBuilderLearn how to create a variable from a parameter in Command Line
Printable version of all geoprocessing data types
Click here to view a PDF of the Geoprocessing data types. If this link doesn't work, you can open the document (Geoprocessing_data_types.pdf) from the \arcgis\Documentation folder in your ArcGIS Desktop install location.
To view this document, you need a copy of Adobe Reader, which you can download free from
http://www.adobe.com/products/acrobat/readstep.html.
Data types have a user interface control
Every geoprocessing data type has an associated user interface control. These user interface controls are used by ArcGIS to construct a tool's dialog.
Determining a parameter's data type
There are several ways to determine the data type of a parameter.
- In a tool's reference page, both the Command line syntax section and the Scripting syntax section contain a table describing each parameter and its data type.
Learn how to navigate to a tool's reference page
- In ModelBuilder, create a variable from a tool's parameter, then right-click the variable, click Properties, then click the Data Type tab. The data type will be listed at the top of the dialog box.
- In ModelBuilder, create a variable from a tool's parameter, open the variable, and click Show Help. The side-panel help will list the data type.
Learn how to create a variable from a parameter in ModelBuilder
- In ModelBuilder, create a model report. The report will list all data types for all parameters.
Learn how to make a model report
- In Command Line, create a variable from a parameter. After creating the variable, open the Variable Manager, which will list the data type of the variable, as shown below.
Learn more about creating variables in Command Line
Every data type has a string syntax, or format, which is what you enter for a parameter in the command line. This string is also what is passed to scripts.
Most data types have a very simple string syntax, such as the path name to a dataset, a number, or a keyword.
The string syntax for a data type can be found in the
table of data types table of data types on a tool's reference page that uses the data type.
Learn how to navigate to a tool's reference page
If you are unclear a particular string syntax for a data type, you can try this:
- Locate a tool that uses the data type.
- Execute the tool using its dialog.
- In the progress dialog or the Command Line window message section, the string syntax for the data type will be shown. If need be, you can copy text from the progress dialog or Command Line window message section.
Data types and scripting objects
The string syntax of some data types is too complex to use in a script. For example, here is the text string for the Spatial Reference data type that defines an Eckert IV coordinate system:
PROJCS['World_Eckert_IV',
GEOGCS['GCS_WGS_1984',
DATUM['D_WGS_1984',
SPHEROID['WGS_1984',6378137.0,298.257223563]],
PRIMEM['Greenwich',0.0],
UNIT['Degree',0.0174532925199433]],
PROJECTION['Eckert_IV'],
PARAMETER['False_Easting',0.0],
PARAMETER['False_Northing',0.0],
PARAMETER['Central_Meridian',0.0],
UNIT['Meter',1.0]]
For data types with complex strings, ESRI has created scripting objects with methods and properties that allow you to easily create and modify the data type.
Learn more about scripting objects for complex data types
Data types and ArcObjects
When using a system programming language (such as .NET or Java), you can execute geoprocessing tools using the IGeoProcessor object. When executing tools in this manner, tool parameters (data types) can either be strings, like you would use in the command line, or an ArcObject.
Learn more about using ArcObjects as tool parameters