Passing GPString value via Flex

In this example from the ArcGIS for Flex samples page: Clip and Ship

I am curious how from this function how the label property of each check box that is passed as input for the Layers_to_Clip parameter of the GPService are interpreted by the GPService as actual pieces of data.

private function getLayersToClip():Array { var layersToClip:Array = []; if (incidentPointsCheckBox.selected) { layersToClip.push(incidentPointsCheckBox.label); } if (incidentLinesCheckBox.selected) { layersToClip.push(incidentLinesCheckBox.label); } if (incidentAreaCheckBox.selected) { layersToClip.push(incidentAreaCheckBox.label); } return layersToClip; }

I have looked at the Clip and Ship data from the ArcTutor files and don't understand how the GPString values - which in this case are "Input Incident Points", "Input Incident Polylines", and "Input Incident Polygons" - correspond to any of the map layers.

Part 2) Ideally I would like to change my Flex application to take items selected from checkboxes and pass them into my model in the same fashion, except I won't be extracting them but using them in analysis. If preprocessing is done, every input would be a raster dataset regardless of the original geometry and the output would be a raster as well. How can I have those checkboxes refer to selected input rasters in a database location or within the map document/gp service?

Thanks in advance, I've been banging my head against the wall with this one,


So the function getLayersToClip creates and returns an array of string items. This array is returned to the calling line

var layersToClip:Array = getLayersToClip();

in the function createRequestObject

As the name suggestes this function is creating an object that will store all of the required inputs for the GP Service. This function returns an object of key:value pairs, one of which is the layersToClip array. This is defined in the line '

"Layers_to_Clip": layersToClip,'

The other key value pairs are:

"Area_of_Interest": areaOfInterestFeatures, "Feature_Format": downloadFormat

I'm guessing that each key corresponds to a required input of the GP Service and the value part will be the values actually passed, (you can see the required input names and the value type by looking at the rest endpoint:

Once the object with the required inputs has been created it is returned to the calling function extractData.

var requestObject:Object = createRequestObject();

This function stores the returned object as a variable called requestObject then calls the execute method on the GP service and passes the input parameter object as an argument



I'm not sure what you want to do with you list of rasters but the example above really just collects some text into an array. You could edit it to have an array of anything you want, be it raster names, locations of files on disk or even data streams. It will depend on what inputs you analysis model calls for. But for performance reasons I wouldn't pass raster objects directly, rather I would pass pointers to them.