How to use the ESRI ExtractData Geoprocessing Service in the latest .Net SDK

123
5
05-20-2020 02:15 PM
BrockHayes
New Contributor

I'm using the Extract Data Geoprocessing service at this link:

 Extract Data Task (HomelandSecurity/Incident_Data_Extraction) 

I've created a GeoprocessingTask and I've added the GeoprocessingParameters for "Layers_to_Clip" and "Feature_Format". I'm struggling with trying to determine what I need to provide for the "Area_of_Interest" parameter as I can get the geometry from my GraphicsOverlay, but I don't know how to turn the geometry into a GPFeatureRecordSetLayer as referred to in the service as this no longer exists to my knowledge in the newest version of the SDK. Any help would be appreciated.

Link to the code I'm referring to: https://paste.ofcode.org/uAnZfzTNUUcuMaCBYnLFS

Reply
0 Kudos
5 Replies
BrockHayes
New Contributor

Alright, so I've figured out the "Area_of_Interest" parameter, but now I'm having issues with the "Layers_to_Clip" parameter. I'm passing a list of GeoprocessingStrings here:

extractDataParameters.Inputs.Add("Layers_to_Clip", new GeoprocessingMultiValue<GeoprocessingString>(geoprocessingStrings));

So geoprocessingStrings is the list of GeoprocessingStrings and I am getting the string containing the layer name when I check the list, but I am still getting an error when I try to create the job and get the results as the HTTP request says "Invalid value for parameter 'Layers_to_Clip". Could someone help with this issue?

Reply
0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

I recommend testing the service endpoint in the browser and comparing the request URL with that made by ArcGIS Runtime (add a handler for the HttpRequestBegin event).

It is possible, since that service is running on a version of ArcGIS that is no longer supported that there could be a difference in the way the parameters are requested in later versions.

ArcGISHttpClientHandler.HttpRequestBegin += (sender, request) =>
{
// ... Check the request URL
};‍‍‍‍‍‍‍

Thanks

Mike

Reply
0 Kudos
BrockHayes
New Contributor

Hi Michael,

I just checked this and it doesn't appear that the request URL is asking for different parameters as I just made a post request with Postman and the parameters are the same.

Reply
0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Are you able to get the job to succeed when running via the web browser? (Submit Job: Extract Data Task)

Thanks

Mike

Reply
0 Kudos
BrockHayes
New Contributor

I've marked this question as answered as I've came up with a better solution to my issue than using the GeoProcessing service. Thank you for your time.

Reply
0 Kudos