Sending FeatureSet as a parameter to geoprocessing task

3147
1
05-15-2016 10:55 PM
ModyBuchbinder
Esri Regular Contributor

I am running a gp tool with point feature set as input parameter.

I would like to user to click on a few points and send it as a parameter.

I can easily do it with one point:

var inputPoint = await MyMapView.Editor.RequestPointAsync();

parameter.GPParameters.Add(new GPFeatureRecordSetLayer("observer", inputPoint));

I created a GraphicsOverlay and put all the points the user entered.

How do I send this as a parameter? The constructor of GPFeatureRecordSetLayer can get a FeatureSet but I found no way to create it from the GraphicsOverlay

Thanks

0 Kudos
1 Reply
ModyBuchbinder
Esri Regular Contributor

Found the solution (with a little help from my friends)

List<Feature> fList = new List<Feature>();

for (int i = 0; i < _inputOverlay.Graphics.Count; i++)

{

    fList.Add(_inputOverlay.Graphics as Feature);

}

FeatureSet fs = new FeatureSet(fList);

0 Kudos