Select to view content in your preferred language

"Near" geoprocessing service and GPMultiValue type

2759
2
05-21-2012 03:19 AM
Jeanlamou
New Contributor
I'm trying to consume a geoprocessing service that uses ???Near??? analysis tool.
Input Parameters:
in_feature1 (type: GPString)
in_featureliste (type: GPMultiValue:GPString)
The service works fine within the ArcGIS service directory interface.
I'm wondering if Flex code supports the GPMultiValue:GPString type? Is there any sample (the nearest features)?

Thanks,

Jean
Tags (2)
0 Kudos
2 Replies
IvanBespalov
Regular Contributor
From REST API help
GPMultiValue
Note that support for the GPMultiValue parameter type was added at 10

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.

Note that at 10.0 only GPMultiValue:GPString data type is supported

From 10.1 onwards all GP data types will be supported in a GPMultiValue.
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 1: GPMultiValue:GPString data type
["Parcels", "Street Lights"]


Example 2: GPMultiValue:GPLinearUnit data type:
[
  { "distance" : 345.67, "units" : "esriMiles" },
  { "distance" : 36, "units" : "esriMiles" }
]


via Geoprocessing task you can
- Send a request to the server to execute a synchronous geoprocessing task.
- Submit a job request to the server to execute an asynchronous geoprocessing task.

I think input parameters are:
var inputParams:Object = new Object();
inputParams.in_feature1 = "string type parameter"; // GPString = String
inputParams.in_featureliste = ["Red", "Green", "Blue"]; // GPMultiValue:GPString = Array
// yourGPTask.execute(inputParams); // - synchronous 
// yourGPTask.submitJob(inputParams, new AsyncResponder(resultfunctionname, faultfunctionname ...)); // - asynchronous
0 Kudos
Jeanlamou
New Contributor
it works.
Thank you Ivan,

Jean
0 Kudos