ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Data types for geoprocessing tool parameters

  • Where data types are needed
  • Determining a parameter's data type
  • String syntax
  • Data types and scripting objects

Geoprocessing is built around the concept of data types. Every tool parameter has an associated data type that defines 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 -2,147,483,648 and 2,147,483,647). In addition to these simple data types, there are dozens of other data types built specifically for data found in ArcGIS, such as field, coordinate system, and extent.

Documentation for each data type is found in Geoprocessing_data_types.pdf. If this link doesn't work, you can open the document (Geoprocessing_data_types.pdf) from the \arcgis\Documentation folder in your ArcGIS for Desktop installation 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.

Where data types are needed

Casual geoprocessing users don't need to know about data types. But there are 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.
  • When adding a script tool using the Script Tool wizard, you need to provide the data type for each of the script tool's parameters.

In the case of ModelBuilder, most of the time you create variables from an existing tool parameter. Since all parameters have an associated data type, the variable is automatically created with the correct data type.

Determining a parameter's data type

There are several ways to determine the data type of a parameter:

  • In a tool's reference page, the syntax section has a table describing each parameter and its data type.
  • In ModelBuilder, create a variable from a tool's parameter. Right-click the variable, click Properties, then click the Data Type tab. The data type is listed at the top of the dialog box.
  • In ModelBuilder, create a model report. The report lists all data types for all parameters.

String syntax

Every data type has a string syntax used in the tool dialog box and in scripting. Most data types have a very simple string syntax, such as the path name to a dataset, a number, or a keyword. For example, the field data type is the name of the field. Other data types have more complex syntax.

The string syntax for a data type can be found in the PDF file described above. If you are unclear of a particular string syntax for a data type, you can try this:

  1. Locate a tool that uses the data type.
  2. Execute the tool using its dialog box.
  3. In the Results window, right-click the result and click Copy as Python snippet. You can then paste this snippet into any text editor (or the Python window) and examine the string values of all parameters.

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, arcpy contains classes with methods and properties that allow you to easily create and modify the data type. For example, see the SpatialReference class.

Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal