FRAMES | NO FRAMES Description | Parameters | Examples | Result Values
GP Result

This is an archive of a previous version of the ArcGIS REST API. The current version can be found at http://resources.arcgis.com/en/help/arcgis-rest-api/

URL http://<job-url>/results/<param-name>
Parent Resource Job

Description

The GP result resource represents a result parameter for a GP job. It provides information about the result parameter such as its name, data type and value. The value is the most important piece of information provided by this resource. Based on the data type of the parameter, the values provide different types of information. Given this fact, the value will have different structures based on the data type as defined below.

Resource Hierarchy

GP Result

Parameters

Parameter Details
f Description: The response format. The default response format is html. Support for f=amf was added at 10.

Values: html | json | image | kmz | amf
outSR Description: The spatial reference of the output geometries.

The spatial reference can be specified as either a well-known ID or as a spatial reference json object.

This parameter is applicable for result parameters that contain geometries. This parameter can be used to return the geometries in a spatial reference that is different from the spatial reference in which the outputs were initially created.
returnType Description: If the GP service is associated with a result map service, the default output for GPRasterDataLayer and GPFeatureSetLayer parameters is a map image. However, you can explicitly request the raw raster data by using returnType and setting its value to data.

Values: data

Example Usage

Example 1: For a Mailing List task job as described in the Job Details doc's Examples section, you can get access to its Report_html result parameter with the following URL:

http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_CadastralData_Portland/GPServer/MailingList/jobs/jdb4cce48c464424e913c15c4f419b32a/results/Report_html

Note that jdb4cce48c464424e913c15c4f419b32a is an example Job ID and the Job ID of your job might vary.

JSON Response Syntax

{
"paramName" : "<paramName>",
"dataType" : "<dataType>",
"value" : <valueLiteralOrObject>
}

JSON Response Example

{
"paramName" : "Output_String",
"dataType" : "GPString",
"value" : "TestString"
}

Parameter Values

The value field in the JSON response above can vary based on the data type of the parameter. For certain data types such as GPFeatureRecordSetLayer and GPRasterDataLayer, it can vary further based on whether the GP service is associated with a result map service or not.

GPBoolean, GPDouble, GPLong and GPString

These simple data types have parameter values that are their literal values.

JSON Response Syntax

{
"paramName" : "<paramName>",
"dataType" : "<GPBoolean | GPDouble | GPLong | GPString>",
"value" : <valueLiteral>
}

JSON Response Example

{
"paramName" : "Output_Double",
"dataType" : "GPDouble",
"value" : 1234.56
}

GPDate

The value for GPDate data type is a number that represents the number of milliseconds since epoch (January 1, 1970) in UTC.

JSON Response Syntax

{
 "paramName": "<paramName>",
 "dataType": "GPDate",
 "value": <millisecondsSinceEpoch>
}

JSON Response Example

{
 "paramName": "Output_Date",
 "dataType": "GPDate",
 "value": 1199145600000 // 1 Jan 2008 00:00:00 GMT
}

Note that the string based representation of dates has been deprecated at 10 and is no longer supported.

GPLinearUnit

The parameter value for GPLinearUnit is a JSON structure with the following fields.

JSON Response Syntax

{
"paramName" : "<paramName>",
"dataType" : "GPLinearUnit",
"value" : { "distance" : <distance>, "units" : "<units>" }
}

JSON Response Example

{
"paramName" : "Output_Linear_Unit",
"dataType" : "GPLinearUnit",
"value" : { "distance" : 1234.56, "units" : "esriMiles" }
}

GPDataFile

The parameter value for GPDataFile is a JSON structure with a url field. The value of the url field is a URL to the location of the data file.

JSON Response Syntax

{
"paramName" : "<paramName>",
"dataType" : "GPDataFile",
"value" : { "url" : "<url>" }
}

JSON Response Example

{
"paramName" : "Output_File",
"dataType" : "GPDataFile",
"value" :
{
"url" : "http://flame7/arcgisjobs/ByValTools_GPServer/J1E7A1738AC054CDCBFC4A413DD9033CE/scratch/output.txt"
}
}

GPRasterData

The parameter value for GPRasterData is a JSON structure with the following fields.

JSON Response Syntax

{
"paramName" : "<paramName>",
"dataType" : "GPRasterData",
"value" : { "url" : "<url>", "format" : "<format>" }
}

JSON Response Example

{
"paramName" : "Output_Raster",
"dataType" : "GPRasterData",
"value" :
{
"url" : "http://flame7/arcgisjobs/ByValTools_GPServer/JD613584CA6AC462AB8229A9A27B3DA79/scratch/slpgrd.tif",
"format" : "tif"
}
}

GPRecordSet

The parameter value for GPRecordSet is a JSON structure with the field features.

The features field is an array of features. Each feature in turn contains an attributes field. attributes are key-value pairs where the key is a field name in the list of fields of the record set and the value is the value of the corresponding field.

Note: At 9.3 SP1 an exceededTransferLimit property was added to the JSON response. This property will be true only if the number of records exceeds the maximum number configured by the server administrator. Otherwise, it will be false.

JSON Response Syntax

{
"paramName" : "<paramName>",
"dataType" : "GPRecordSet",
"value" :
{
"features" : [
{
"attributes" :
{
"<field1>" : <value11>,
"<field2>" : <value12>
  }
 },
{
"attributes" :
{
"<field1>" : <value21>,
"<field2>" : <value22>
  }
}
],
"exceededTransferLimit" : false | true
}
}

JSON Response Example

{
"paramName" : "Output_Record_Set",
"dataType" : "GPRecordSet",
"value" :
{
"features" : [
{
"attributes" :
{
"TextField" : "a",
"IntField" : 1234,
"DoubleField" : 1234.56,
"DateField" : "Sun Apr 10 16:00:00 PST 1977"
  }
 },
{
"attributes" :
{
"TextField" : "b",
"IntField" : 5678,
"DoubleField" : 5678.91,
"DateField" : "Mon Apr 11 16:00:00 PST 1977"
  }
 }
],
"exceededTransferLimit" : false
 }
}

Map Images as Results

Map images can be a result of a GP job. If a GP service is associated with a result map service, the results of GPFeatureRecordSetLayer and GPRasterDataLayer data types can be drawn by the result map service and hence can be provided to the client as a map image.

In such cases where the result is a map image, the value field for the GP parameter is a JSON structure with a mapImage field. The structure of the mapImage field is a JSON object whose structure is same as that of the JSON response of the export map operation. Further, most of the query parameters available for the export map operation are available for GP map image results as well. The only exceptions are the layers and the transparent parameters. The layers parameter is not available for GP map image results because it exports the map only for the layer corresponding to the GP parameter. The transparent parameter is available, however, the default value is true for GP map image results whereas the default value is false for the export map operation.

JSON Response Syntax

{
"paramName" : "<paramName>",
"dataType" : "<GPRasterDataLayer | GPFeatureRecordSetLayer>",
"value" :
{
"mapImage" :
{
"href" : "<href>",
"width" : <width>,
"height" : <height>,
"extent" : {<envelope>},
"scale" : <scale>
  } 
}
}

JSON Response Example

{
"paramName" : "Output_Raster_Layer",
"dataType" : "GPRasterDataLayer",
"value" :
{
"mapImage" :
{
"href" : "http://flame7/arcgisoutput/_ags_map40a7f57f31474933a94b5c672b7205f0.png",
"width" : 400,
"height" : 400,
"extent" : {
"xmin" : -109.55, "ymin" : 25.76, "xmax" : -86.39, "ymax" : 49.94,
"spatialReference" : {"wkid" : 4326}
},
"scale" : 2.53E7
  } 
}
}

GPRasterDataLayer

If the GP service is associated with a result map service, the default output for GPRasterDataLayer parameters is a map image. However, you can explicitly request the raw raster data by using the returnType parameter in the URL and setting its value to data.

If the GP service is not associated with a result map service, or if the returnType parameter is set to the value data, the parameter value for GPRasterDataLayer is a JSON structure with the following fields.

JSON Response Syntax

{
"paramName" : "<paramName>",
"dataType" : "GPRasterDataLayer",
"value" : { "url" : "<url>", "format" : "<format>" }
}

JSON Response Example

{
"paramName" : "Output_Raster_Layer",
"dataType" : "GPRasterDataLayer",
"value" :
{
"url" : "http://flame7/arcgisjobs/ByRefTools_GPServer/J3D1737BA4584441FACBD5563AD1A47D5/scratch/outrast.tif",
"format" : "tif"
}
}

GPFeatureRecordSetLayer

If the GP service is associated with a result map service, the default output for GPFeatureRecordSetLayer parameters is a map image. However, you can explicitly request the feature data by using the returnType parameter in the URL and setting its value to data.

If the GP service is not associated with a result map service or if the returnType parameter is set to the value data, the parameter value for GPFeatureRecordSetLayer is a JSON structure with the following fields.

JSON Response Syntax

{
"paramName" : "<paramName>",
"dataType" : "GPFeatureRecordSetLayer",
"value" :
{
"geometryType" : "<geometryType>",
"spatialReference" : {<spatialReference>},
"features" : [
{
"geometry" : {<geometry1>},
"attributes" :
{
"<field1>" : <value11>,
"<field2>" : <value12>
  }
 },
{
"geometry" : {<geometry2>},
"attributes" :
{
"<field1>" : <value21>,
"<field2>" : <value22>
  }
 }
]
}
}

JSON Response Example

{
"paramName" : "Output_Features",
"dataType" : "GPFeatureRecordSetLayer",
"value" :
{
"geometryType" : "esriGeometryPoint",
"spatialReference" : {"wkid" : 4326}, 
"features" : [
{
"geometry" : {"x" : -104.36, "y" : 34.657},
"attributes" :
{
"TextField" : "a",
"IntField" : 1234,
"DoubleField" : 1234.56,
"DateField" : "Sun Apr 10 16:00:00 PST 1977"
  }
},
{
"geometry" : {"x" : -114.749, "y" : 31.439},
  "attributes" :
{
"TextField" : "b",
"IntField" : 5678,
"DoubleField" : 5678.91,
"DateField" : "Mon Apr 11 16:00:00 PST 1977"
  }
}
]
 }
}

GPMultiValue

Note that support for the GPMultiValue parameter type was added at 10 and only GPMultiValue:GPString datatype is supported at 10.0

The fully-qualified data type for a GPMultiValue parameter is GPMultiValue:<memberDataType>, where memberDataType is one of the data types defined above. For ex. GPMultiValue:GPString, GPMultiValue:GPLong, etc.

The parameter value for GPMultiValue data types is a JSON array. Each element in this array is of the data type as defined by the memberDataType suffix of the fully-qualified GPMultiValue data type name.

Example: GPMultiValue:GPString data type:
{
 "paramName": "Output_Layers",
 "dataType": "GPMultiValue:GPString",
 "value": ["Parcels", "Street Lights"]
}