I am working on ArcGIS 100.1 Quartz Qt. I created a gpk on ArcMap 10.5. When gpk is not having any inputs, I am getting result from gpk running on Qt Quartz application. I created a gpk which takes raster(tif) and feature layer as input. On computation of gpk I am getting task failed case.
I gave input raster as
inputs["InputRaster"] = new GeoprocessingRaster(QUrl("/home/sau/Work/Bhargav/40m4.tif"),"tif", this);
I gave input feature layer as stated in sample code.
How to give this raster and feature layer as input to gpk in Quartz Qt 100.1 application?
Solved! Go to Solution.
Instead of GeoprocessingRaster, please try using GeoprocessingString, where the value is the path to your raster.
One additional thing to check is when you created your GPK, did you use a Python script tool or a model from ModelBuilder? If you were using a model, be sure to use Inline Variable Substitution to pass the path in. If you are using Python, use GetParameterAsText to obtain the path.
Can you connect to the errorOccurred signal on the task to get the error message?
Here is the REST doc - ArcGIS REST API - Services and Data Types
There is no errorOccurred signal. Connected GeoprocessingJob::jobStatusChanged signal and got error "Failed"(GeoprocessingJob::jobStatus() returning Failed). When I am giving inputs at rest end point,
For raster input given as
{
"url": "http:/home/sau/Work/AfterTrials_July/SAU_GUI/Tpks/4326/40m4.tif",
"format": "tif"
}
as told in ArcGIS REST API - Services and Data Types .
Also tried
"url": "/home/sau/Work/AfterTrials_July/SAU_GUI/Tpks/4326/40m4.tif"
Output:-
{ "jobId": "j74afdffb94c646c8a31802992798e328", "jobStatus": "esriJobFailed", "messages": [ { "type": "esriJobMessageTypeInformative", "description": "Submitted." }, { "type": "esriJobMessageTypeInformative", "description": "Executing..." }, { "type": "esriJobMessageTypeError", "description": "Failed." } ] }
Instead of GeoprocessingRaster, please try using GeoprocessingString, where the value is the path to your raster.
One additional thing to check is when you created your GPK, did you use a Python script tool or a model from ModelBuilder? If you were using a model, be sure to use Inline Variable Substitution to pass the path in. If you are using Python, use GetParameterAsText to obtain the path.
Thanks Lucas. After using Inline Variable Substitution for path in ModelBuilder and GeoprocessingString it is working. But what can be the reason for GeoprocessingRaster not working as stated in API reference.
We need to update our documentation to explain this process. As for GeoprocessingRaster, I believe that this is only applicable if you have your raster on a web server and if you author your GP Service in a particular way. For the purposes of the local server analysis like what you are doing, GeoprocessingString is the way to go.
Thanks Lucas for your explanation and help.