How can I pass a polygon to my Geoprocessing Service?

774
2
06-16-2014 11:33 AM
CraigPerreault
New Contributor II
I am able to successfully create geoprocessing tools with string arguments and call them from my Silverlight applications. But I am unable to pass a graphic or a polygon as an input parameter. Can you point me in the right direction?  Thanks.
Tags (2)
0 Kudos
2 Replies
OwenEarley
Occasional Contributor III
I haven't tried this using silverlight but I think all the ESRI web APIs would need to pass a GPFeatureRecordSetLayer object to the server for geometry objects - more information is availabe here:
http://resources.arcgis.com/en/help/main/10.1/index.html#/Using_geoprocessing_tasks_in_web_applicati...

Also, check out the message in a bottle sample at:
http://resources.arcgis.com/en/help/silverlight-api/concepts/#/Geoprocessing_task/01660000000n000000...

The message in a bottle sample uses a point but you should be able to substitute this with your polygon or graphic input:

List<GPParameter> parameters = new List<GPParameter>();
    parameters.Add(new GPFeatureRecordSetLayer("Input_Polygon", poly));
    ...any other tool parameters...
    parameters.Add(new GPDouble("Other_Input", Convert.ToDouble(DaysTextBox.Text)));


Owen
www.spatialxp.com.au
0 Kudos
CraigPerreault
New Contributor II
I should have asked �??How can I create a geoprocessing service that receives the geometry of polygon�?�
I am able to pass graphics to http://sampleserver1.arcgisonline.com, like the message in a bottle example,
but unable to create a new service that accepts polygon geometry.
0 Kudos