Regarding Input to GPK

839
6
Jump to solution
10-02-2017 10:00 PM
Bhargav_KumarK
New Contributor

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?

0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

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.

View solution in original post

0 Kudos
6 Replies
LucasDanzinger
Esri Frequent Contributor

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 

0 Kudos
Bhargav_KumarK
New Contributor

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."     }   ] }
0 Kudos
LucasDanzinger
Esri Frequent Contributor

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.

0 Kudos
Bhargav_KumarK
New Contributor

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.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

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.

0 Kudos
Bhargav_KumarK
New Contributor

Thanks Lucas for your explanation and help.

0 Kudos