Select to view content in your preferred language

Data Extraction Service

3387
6
11-08-2010 08:06 AM
PaulHuppé
Deactivated User
Hi,

At the following URL, http://resources.arcgis.com/gallery/video/arcgis-server/details?entryID=4A08A4AE-1422-2418-888D-E79B..., ArcGIS Server Product Manager Ismael Chivite describes how to use the Data Extraction Service with the Flex Viewer.  Is there a similar step-by-step guide for doing the same with Silverlight?

Thanks,
Paul
0 Kudos
6 Replies
RexHansen
Esri Contributor
Unfortunately there is not a video for Silverlight or JavaScript specifically, but the steps for setting up a �??data extraction�?� service are the same regardless of the client API.   We host a sample data extraction service (actually a GP and Map service) here:
http://sampleserver4.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity
We'll consider adding a sample that uses this service to the interactive SDK.  In the meantime, we do host a similar sample here:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ClipFeatures
You should be able to gleen what is necessary for consuming an async data extraction GP service from that sample.  The data for this sample is included with the ArcGIS .NET SDK under: <ArcGIS Developer Kit install directory>/Samples/data/GP/RunClip/USA_data_ClipTools and <ArcGIS Developer Kit install directory>/Samples/data/USA/

-Rex
0 Kudos
PaulHuppé
Deactivated User
Hi Rex,
I have had no problems setting up the map and GP services. My problem seems to be in the code behind to call the GP service.  I have code to setup the parameters in code behind, but when the job is submitted, I get no errors, but it also never seems to execute.  The application just sits there waiting and never gets to the Geoprocessor_JobCompleted method.  If I look at the rest service via the web, I see the following parameters:

Parameter direction :esriGPParameterDirectionInput
Parameter: Layers_to_Clip        Data Type: GPMultiValue:GPString
Parameter: Area_of_Interest     Data Type: GPFeatureRecordSetLayer
Parameter: Feature_Format      Data Type: GPString
Parameter: Raster_Format        Data Type: GPString

Parameter direction: esriGPParameterDirectionOutput
Parameter: Output_Zip_File      Data Type: GPDataFile

In my code behind, I have the following:
            parameters.Add(new GPString("Layers_to_Clip", _layerNames));
            parameters.Add(new GPFeatureRecordSetLayer("Area_of_Interest", _clipRect));
            parameters.Add(new GPString("Feature_Format", "File Geodatabase - GDB - .gdb"));
            parameters.Add(new GPString("Raster_Format", "File Geodatabase - GDB - .gdb"));
            parameters.Add(new GPString("Output_Zip_File", "output.zip"));
            geoprocessorTask.SubmitJobAsync(parameters);

Where _layerNames is a list of desired layers separated by ",". How do I send a GPMultiValue?
         _clipRect is a polygon that the user draws on the map on the graphics layer

Paul
0 Kudos
PaulHuppé
Deactivated User
Hi,
I simplified my task to only accept the AOI, the input feature format and output feature format to try to find out what is going wrong.  Now, at least I am getting some feedback from the GP service.  If I look at Fiddler when executing the task, I get what you see in the attached picture.

The value of AreaOfInterest is:

{"geometryType":"esriGeometryEnvelope","spatialReference":{"wkid":54016},"features":[{"geometry":{"xmin":-10804935.8343254,"ymin":5075598.21276361,"xmax":-4965461.02456827,"ymax":8945129.7132051,"spatialReference":{"wkid":54016}},"attributes":{}}]}
0 Kudos
PaulHuppé
Deactivated User
I think I am getting closer.  I modified my C# code to send a Polygon instead of a Geometry. I am now sending the following for the AreaOfInterest:

{"geometryType":"esriGeometryPolygon","spatialReference":{"wkid":54016},"features":[{"geometry":{"spatialReference":{"wkid":54016},"rings":[[[-9644076.38419297,5796738.17420953],[-9644076.38419297,7907391.71990488],[-5457946.85189718,7907391.71990488],[-5457946.85189718,5796738.17420953],[-9644076.38419297,5796738.17420953]],[[-9239534.45460135,5761560.6151146],[-9239534.45460135,7801859.04262011],[-7216824.80664331,7801859.04262011],[-7216824.80664331,5761560.6151146],[-9239534.45460135,5761560.6151146]]]},"attributes":{}}]}


If I execute the GP task via the REST interface, I get the following results:

Job Status: esriJobFailed

Job Messages: 


esriJobMessageTypeInformative: Submitted. 
esriJobMessageTypeInformative: Executing... 
esriJobMessageTypeInformative: Executing (ExtractData): ExtractData "Feature Set" "File Geodatabase - GDB - .gdb" "File Geodatabase - GDB - .gdb" 
esriJobMessageTypeInformative: Start Time: Fri Nov 19 09:35:38 2010 
esriJobMessageTypeInformative: Running script ExtractData... 
esriJobMessageTypeError: ERRORS: Traceback Info: File "\\S5-BSC-IMS2\MapDefinitions\BaseMapService\Scripts\ExtractData.py", line 330, in zipFolder = clipAndConvert(layers, areaOfInterest, featureFormat, rasterFormat, coordinateSystem) Error Info: : exceptions must be old-style classes or derived from BaseException, not str 
esriJobMessageTypeInformative: Completed script ExtractData... 
esriJobMessageTypeError: Failed to execute (ExtractData). 
esriJobMessageTypeInformative: Failed at Fri Nov 19 09:35:51 2010 (Elapsed Time: 13.00 seconds) 
esriJobMessageTypeError: Failed. 


Line 330 in the Python script corresponds to:

zipFolder = clipAndConvert(layers, areaOfInterest, featureFormat, rasterFormat, coordinateSystem)


I am not sure what that error refers to. It does not tell me which parameter it is having problems with!
0 Kudos
JingjingLi
Deactivated User
I also have the Rectangle issue. But the polygon Area_Of_Interest works for me.
0 Kudos
PaulHuppé
Deactivated User
Hi,

My AOI does not work,

I also have the Rectangle issue. But the polygon Area_Of_Interest works for me.


Would you mind sharing your C# and Python code?
0 Kudos