Select to view content in your preferred language

Clip and ship geoprocessing service to be utilized in silverlight app

2979
4
07-26-2010 03:31 AM
TamasHajdu
Emerging Contributor
Hi,

We are planning to implement a new function in our existing web app which would use the clip and ship geoprocessing service. We have set up the geoprocessing service on the server side and did all the prerequired things but we have some difficulties with the coding.
We were not able to find almost any examples or sample codes for doing that, so we could use some help in order to have the basics to be able to build on later.
We`d be happy for any help!
Thanks

Tamas and Sampath
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
The sample which looks the closest of what you need is this one : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ClipFeatures

Could you give more information about what is not working for you with this sample?
0 Kudos
AnandUpadhya
Emerging Contributor
The Extract Data and Email Task model that is in ArcGIS Server 10 needs to be modified a bit in order to use with silverlight. Currently the GPMultiValue:GPString data type is not in the API so the Layer to be clipped must be fixed in the model itself. Other parameters can be passed normally.

Here's what I did:
1. Create a graphics layer
2. Create a Draw object for drawing polygons add them to the graphics layer for display
3. Add all the polygons drawn by the user to the parameter of type GPFeatureRecordSetLayer

GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
            Graphic graphic = new Graphic()
            {
                Geometry = args.Geometry,
                Symbol = _activeSymbol
            };
            graphicsLayer.Graphics.Add(graphic);

parameters.Add(new GPFeatureRecordSetLayer("Area_of_Interest", args.Geometry));

4. Then add the rest of the parameter and finally submit the job
0 Kudos
RexHansen
Esri Contributor
There are a number of resources available online to assist you with consuming geoprocessing services:

Concepts: http://help.arcgis.com/en/webapi/silverlight/help?GP_task.htm

OMD (in Tasks section): http://help.arcgis.com/en/webapi/silverlight/help/ArcGISSilverlightOMDs.pdf

Interactive samples (links to first sample in a section of geoprocessing samples): http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MessageInABottle

Library Reference (link to Geoprocessor task): http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm?ESRI.ArcGIS.Client~ESRI.ArcGIS.Cli...

The GP* types used by the task are in the same namespace as the task (ESRI.ArcGIS.Client.Tasks). 

On a side note, the data for the geoprocessing service demonstrated in the Clip Features sample mentioned in the post by dbroux above (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ClipFeatures) is available with ArcGIS Server 10 SDK.  Here is the .NET ADF sample that references the data: http://help.arcgis.com/en/sdk/10.0/serveradf_net/conceptualhelp/index.html#/ArcGIS_ClipShip_Geoproce...

Hope this helps
0 Kudos
PaulHuppé
Deactivated User
Where do I find this extract Data and Email task model?

Also, it would be nice to get an A-Z recipe for doing this.

One more thing. It would be nice to be able to clip/ship all/some layers from all/some services that are being used on the map.

Thanks,
Paul

The Extract Data and Email Task model that is in ArcGIS Server 10 needs to be modified a bit in order to use with silverlight. Currently the GPMultiValue:GPString data type is not in the API so the Layer to be clipped must be fixed in the model itself. Other parameters can be passed normally.

Here's what I did:
1. Create a graphics layer
2. Create a Draw object for drawing polygons add them to the graphics layer for display
3. Add all the polygons drawn by the user to the parameter of type GPFeatureRecordSetLayer

GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
            Graphic graphic = new Graphic()
            {
                Geometry = args.Geometry,
                Symbol = _activeSymbol
            };
            graphicsLayer.Graphics.Add(graphic);

parameters.Add(new GPFeatureRecordSetLayer("Area_of_Interest", args.Geometry));

4. Then add the rest of the parameter and finally submit the job
0 Kudos