Geoprocessing task parameters
Each geoprocessing task has at least one parameter. Each parameter of a task has a set of descriptive properties that help you understand the parameter and provide appropriate value for the successful execution of the task. The screen capture below shows an example task parameter Distance, as seen in geoprocessing task page in the services directory. The significance of each property is described below.
Data type
The data type of the parameter specifies the type of value that the client must provide for the parameter. The value of a parameter can be as simple as a string, long, double, Boolean or date. Or it can be a featureset (a collection of features with attributes similar to featureclass), table, or a raster. For example, if the data type is a long you must provide a numeric value between −2,147,483,648 to 2,147,483,647. Any other decimal or string values will result in unexpected behavior of the tool. Similarly, if it is a raster data type, you must provide an appropriate raster data to successfully run the tool. The list below shows the data types of a task parameter and its expected values.
Data type | Value | Example JSON representation |
GPLong |
An integer value between −2,147,483,648 to 2,147,483,647 |
345 |
GPDouble |
Decimal values |
1.414 |
GPString |
String |
TestString |
GPBoolean |
true or false |
true |
GPLinearUnit |
A value that has a distance value and its unit of measurement such as miles, kilometers, feet, and so on. |
{ "distance" : 345.678, "units" : "esriMiles" } |
GPDate |
Number that represents the number of milliseconds since epoch (January 1, 1970) in UTC. |
1199145600000 |
GPDataFile |
Any file type such as .txt, .pdf, .csv, and so on. |
{ "url" : "http://myserver/myfile" } |
GPRasterDataLayer |
Raster data that consists of a matrix of cells (or pixels) organized into rows and columns (grid) where each cell contains a value representing information. |
{ "url" : "http://myserver/lake.tif", "format" : "tif" } |
GPRecordSet |
Tables that are represented in rows and columns. |
|
GPFeatureRecordSetLayer |
Features that have a geometry, spatial reference, field definitions, and features. |
GPFeatureRecordSetLayer JSON
|
GPMultiValue |
An array of GP parameter values of the same data type. For example, GPMultiValue:GPString, GPMultiValue:GPLinearUnit |
["Parcels", "Street Lights"] [ { "distance" : 345.67, "units" : "esriMiles" }, { "distance" : 36, "units" : "esriMiles" } ] |
- For GPRecordSet and GPFeatureRecordSetLayer parameters, if you have a large number of records and features, you can store the JSON structure in a file and provide the URL as an input. For example, { "url" : "http://myserver/myfeatures/afile.txt"}. The text file must have featureset or recordset in JSON format.
- In the case of GPMultiValue:GPFeatureRecordSetLayer data type, the featuresets must have field definitions for successful execution.