I can't find anything in the docs so thought it worth asking...
Is there any QML API support for calling a geoprocessing service?
Cheers
-Paul
Solved! Go to Solution.
Hi Paul,
If there is nothing in Runtime that hooks in, then you could always get to it via the REST interface using the NetworkRequest component.
Hi Paul,
If there is nothing in Runtime that hooks in, then you could always get to it via the REST interface using the NetworkRequest component.
Our Runtime QML API does not support GP yet. However, we plan to support it in our Quartz release, so until AppStudio is able to move to this, you will need to do what Gareth suggests and perform your own REST request.
Hi,
Is there an example that demonstrates a REST request for a geoprocessing service on a server?
Thanks,
Ruthann
Hi,
I am highly interested in this topic. So I ask again: Is there an example of a REST request for a GP service on a server?
That would help me a lot!
Greetings and thanks,
Raphael
Hi Raphael,
there is a sample in AppStudio called networkrequest. It will show an example of making rest calls to an arcgis server. You should be able to follow that and modify it to call a GP service.
cheers,
gareth
Hi Gareth,
thanks for your reply! I tried figuring out how I can call my GP service. I have read the entire docu but I have the following problem:
I want to call my GP service in the networkrequest sample, but how can I specify the input in QML? I tried to build the URL like the examples at ArcGIS REST API :
"http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/PublicSafety/EMModels/GPServer/ERGByChemi...{ \"features\" : [{ \"geometry\" : {\"x\" : -104.44, \"y\" : 34.83}, \"attributes\" : {\"Id\" : 43, \"Name\" : \"Incident\"}}]} &Material_Type=&Wind_Bearing__direction_blowing_to__0_-_360_=&Day_or_Night_incident=&Large_or_Small_spill=&env:outSR=&env:processSR=&f=html"
I thought I need the "..." specified in my URL, but I get the following error message:
"NetworkRequest::setErrorText(const class QString &) "Protocol \"\" is unknown"
Is there another way to call my GP service with specified input?
Thank you in advance!!
Raphael
Did you ever figure this out....
I have a GP Service running and I can input values and it works great...
I just cant figure out how to call that Service from AppStudio and pass it the input parameters.
Geoprocessing is now available in ArcGIS Runtime. You should be able to create a GeoprocessingTask by pointing to your service URL, create/modify parameters, and execute the task/job.
Here is the API ref doc - GeoprocessingTask QML Type | ArcGIS for Developers
Here is some conceptual doc for GP in Runtime - Run a geoprocessing task—ArcGIS Runtime SDK for Qt | ArcGIS for Developers
Here is a sample of using the GeoprocessingTask - arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_QMLSamples/Analysis/AnalyzeViewshed at master · Esri/ar...
THANK YOU FOR YOUR RESPONSE
I have been trying to use that sample for a bit now....new to this....I am simply trying to pass a few parameters to a GP service. Not sure if I have to create a FeatureCollectionTable?
This does not work...but i know the GP service works because I can manually run it....I just cannot figure out how to pass the values
Does anything stick out to you below.
Im stuck on #3
Here is some conceptual doc for GP in Runtime - Run a geoprocessing task—ArcGIS Runtime SDK for Qt | ArcGIS for Developers
If I console.log viewshedParameters below there is nothing in the objects:{} in the object
// ON BUTTON CLICK
viewshedTask.calculateViewshed();
GeoprocessingTask {
id: viewshedTask
url: "https://xxxx/arcgis/rest/services/x/x/GPServer/NewScriptToRun"
function calculateViewshed() {
var paramsvalue = {'OBJECTID':ObjectID,'comments':Comments};
var viewshedParameters = ArcGISRuntimeEnvironment.createObject("GeoprocessingParameters",
{executionType:Enums.GeoprocessingExecutionTypeSynchronousExecute,objectName:"Parameter Name",inputs:paramsvalue });
viewshedJob = viewshedTask.createJob(viewshedParameters);
viewshedJob.start();
}
}
import arcpy
from arcpy import env
import os
# Geting user input for project name, status, type, submital date and planner name
varObjectID = arcpy.GetParameterAsText(0)
varItem = arcpy.GetParameterAsText(1)