|
POST
|
I figured it out....its working now....sorry...I had the wrong Coordinate I was hard coding
... View more
09-25-2019
05:23 AM
|
0
|
0
|
819
|
|
POST
|
I have a python script that I am accepting parameters from a GP Service The creation of the point works fine... BUT regardless of what I specify for an XY if places the points off the coast of Ecuador The FC is in UTM Zone 17N.... It does not matter if I hard code (-75.5, 38.5) or (1221066.25, 4014421.79) it still drops the point in the same location. varItem = arcpy.GetParameterAsText(0)
varXCoord = arcpy.GetParameterAsText(4)
varYCoord = arcpy.GetParameterAsText(5)
#SNIP
# I set my workspace and FC, start editing,
#SNIP
row_values = [( varItem, varXCoord ,varYCoord)]
print(row_values)
cursor = arcpy.da.InsertCursor(fc,['Item', 'PublicPrivate', 'SHAPE@Y', 'SHAPE@X'])
for row in row_values:
cursor.insertRow(row)
## Stop the edit operation.
edit.stopOperation()
## Stop the edit session and save the changes
edit.stopEditing(True)
... View more
09-25-2019
05:13 AM
|
0
|
1
|
854
|
|
POST
|
Answer from ESRI was if i write the pyton a d publish it to a GP tool service no licensing needed.....well at least the LITE license is enough
... View more
09-23-2019
03:33 PM
|
0
|
0
|
706
|
|
POST
|
I figured it out....had to add "submitJob" to my URL url: "https://xx/arcgis/rest/services/xx/Update/GPServer/NewScriptToRun" url: "https://xx/arcgis/rest/services/xx/Update/GPServer/NewScriptToRun/submitJob"
GeoprocessingTask {
id: updateCursorTask
url: "https://xxx/arcgis/rest/services/Tools/Update/GPServer/NewScriptToRun/submitJob"
var gpParameters = ArcGISRuntimeEnvironment.createObject("GeoprocessingParameters",
{executionType: Enums.GeoprocessingExecutionTypeSynchronousExecute});
var inputs = {};
inputs["Item"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varItem, objectName: varItem});
inputs["PublicPrivate"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varPublicPrivate});
var inputresults = inputs;
gpParameters.inputs = inputs;
// Create the job that handles the communication between the application and the geoprocessing task
updateCursorJob = updateCursorTask.createJob(gpParameters);
updateCursorJob.start();
... View more
09-23-2019
01:55 PM
|
0
|
0
|
1090
|
|
POST
|
Turns out it was the service URL...I changed to the second one and it worked I added the "submitJob" and it worked..... "https://xx/arcgis/rest/services/xx/Update/GPServer/NewScriptToRun"
"https://xx/arcgis/rest/services/xx/Update/GPServer/NewScriptToRun/submitJob"
... View more
09-23-2019
01:50 PM
|
1
|
0
|
1579
|
|
POST
|
Can I call and set the XY location of center of the map with a button to variables? Any example? Maybe each time the map moves it resets the variables?
... View more
09-23-2019
12:30 PM
|
0
|
12
|
4661
|
|
POST
|
My question is this...I am being told that you need a Basic license to edit a secured service. But I can use my secured service from my ArcGIS Server, put it in the Quick Report Template and add points. Do I need a Basic licence if I can already do this in a LITE license?
... View more
09-23-2019
08:11 AM
|
0
|
0
|
1097
|
|
POST
|
Im a bit confused here....I am returning a few results in AppStudio When I am building my inputs {} I order them like this I console.log two variables the "inputs" AND "gpParameters" Look at the results below of each variable....the order in which they are being built is different...I think this is throwing off the values when they get to the Service? Am I correct to assume that the order does not matter.....BUT the input name matters when it is liked up to the GP Service Parameters and the name assigned to them? Where as, if my Input name is "Item" I need a corresponding GP Service Parameter named "Item" Funny thing is that I have that but when I run the code nothing happens.... Is there anyway I can error trap this and alert something from the App Studio Side to the arcgis Server GP tool side... I cant find anything to test from the Submit on the App Studio Side and test if the connection was made to the GP Service var gpParameters = ArcGISRuntimeEnvironment.createObject("GeoprocessingParameters",
{executionType: Enums.GeoprocessingExecutionTypeSynchronousExecute});
var inputs = {};
inputs["Item"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varItem});
inputs["PublicPrivate"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varPublicPrivate});
inputs["CaseNumber"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varCaseNum});
inputs["Comments"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varComments});
inputs["Classification"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varClassification});
inputs["ObjectID"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varObjectID});
inputs["lastEditor"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varlastEditUser});
inputs["LastDate"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varEditedDate});
//inputs["InputString"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varEditedDate});
console.log("inputs: " + JSON.stringify(inputs));
gpParameters.inputs = inputs;
console.log("gp parameters: " + JSON.stringify(gpParameters)); qml: inputs: { "Item":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"shooter"}, "PublicPrivate":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"private"}, "CaseNumber":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"555"}, "Comments":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"stupid comment"}, "Classification":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"Boating"}, "ObjectID":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"2067"}, "lastEditor":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"jay"}, "LastDate":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"5/12/2019"}} qml: gp parameters: { "objectName":"","objectType":"GeoprocessingParameters","error":null,"objects":{},"executionType":1,"inputs": {"CaseNumber":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"555"}, "Classification":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"Boating"}, "Comments":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"stupid comment"}, "Item":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"shooter"}, "LastDate":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"5/12/2019"}, "ObjectID":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"2067"}, "PublicPrivate":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"private"}, "lastEditor":{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":{},"parameterType":9,"value":"jay"}}, "outputSpatialReference":null,"processSpatialReference":null,"returnM":false,"returnZ":false}
... View more
09-20-2019
11:35 AM
|
0
|
2
|
1579
|
|
POST
|
ahhhhh...ok that makes sense....I thought I had to build the parameters and then add it but realize that adding multiple inputs is building that parameters set I can manually run the script on the server and it updates I can run the GP service in ArcGIS Server and it updates I still cannot call it to make it work from AppStudio.... Any ideas where it might be braking.....its works from the script and the GP Service in ArcGIS Server??? GeoprocessingTask {
id: viewshedTask
url: "https://xx/arcgis/rest/services/x/x/GPServer/NewScriptToRun"
function calculateViewshed() {
var varObjectID = "2067";
var varItem = "shooter";
var gpParameters = ArcGISRuntimeEnvironment.createObject("GeoprocessingParameters",
{executionType: Enums.GeoprocessingExecutionTypeSynchronousExecute});
var inputs = {};
inputs["Item"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varItem});
inputs["ObjectID"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varObjectID});
gpParameters.inputs = inputs;
viewshedJob = viewshedTask.createJob(gpParameters);
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)
whereClause = "[OBJECTID] = '{0}'".format(varObjectID)
fc = 'BoatingIncidents'
workspace = arcpy.env.workspace = r'C:\Users\xx\AppData\Roaming\ESRI\Desktop10.5\ArcCatalog\[email protected]'
# Start an edit session. Must provide the workspace.
edit = arcpy.da.Editor(workspace)
# Edit session is started without an undo/redo stack for versioned data
# (for second argument, use False for unversioned data)
edit.startEditing(False, False)
# Start an edit operation
edit.startOperation()
# UPDATE a row in the Feacture Class
Ucursor = arcpy.da.UpdateCursor(fc,["OBJECTID","Item"],whereClause)
for row in Ucursor:
irow = (varObjectID, varItem)
Ucursor.updateRow(irow)
arcpy.RefreshActiveView()
# Stop the edit operation.
edit.stopOperation()
# Stop the edit session and save the changes
edit.stopEditing(True)
... View more
09-20-2019
11:15 AM
|
0
|
0
|
1579
|
|
POST
|
How would I format the string so that I can parse it or write it to variables once I get to the GP Service that is lookin gfor input parameters... varItem = arcpy.GetParameterAsText(0) varPublicPrivate = arcpy.GetParameterAsText(1) varCaseNum = arcpy.GetParameterAsText(2)
... View more
09-20-2019
10:29 AM
|
0
|
5
|
1579
|
|
POST
|
I was able to do this....but don know if this is the correct way....its the only time that I have been able to get a string or Object into the parameters... BUT it show s my string two times....hmmmmm....wicked confused but trying var viewshedParameters = ArcGISRuntimeEnvironment.createObject("GeoprocessingParameters",
{executionType: Enums.GeoprocessingExecutionTypeSynchronousExecute
});
var ObjectID = "2067";
var Comments = "stupid";
var params44 = "{OBJECTID:" + ObjectID + ",comments:" + Comments + "}";
// Add an input location to the geoprocessing parameters
var inputs = {};
inputs["Input_Observation_Point"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", { value: params44 },
);
viewshedParameters.inputs = inputs;
viewshedParameters.objectName = "Parameter Name";
// Create the job that handles the communication between the application and the geoprocessing task
viewshedJob = viewshedTask.createJob(viewshedParameters);
// start the job
viewshedJob.start(); qml: {"objectName":"","objectType":"GeoprocessingJob","error":null,"objects":{},"json":{"geoprocessingJob":{"needGpMapServiceUrl":false,"parameters":
{"executionType":"execute","parameters":
[{"dataType":"GPString","direction":"esriGPParameterDirectionInput","name":"Input_Observation_Point","value":"
{OBJECTID:2067,comments:stupid}"}],"returnM":false,"returnZ":false},
"url":"https://xx/arcgis/rest/services/Tools/Update/GPServer/NewScriptToRun"},"jobType":"geoprocessingJob","status":"notStarted"},
"unknownJson":{},"unsupportedJson":{},"jobType":4,"messages":
{},"serverJobId":"","progress":0,"jobStatus":0,"error":null,"credential":
{"objectName":"","objectType":"Credential","error":null,"objects":
{},"username":"","password":"","authenticationType":0,"referer":"","token":"","tokenExpiry"
:null,"tokenServiceUrl":"","oAuthClientInfo":null,"oAuthAuthorizationCode":"","oAuthRefreshToken":
"","pkcs12Info":null,"sslRequired":false,"authenticatingHost":"","objects":{}},"requestConfiguration":
{"objectName":"","objectType":"RequestConfiguration","error":null,"objects":
{},"timeoutInterval":60,"maxNumberOfAttempts":5,"forcePost":false,
"issueAuthenticationChallenge":true,"userHeaders":{}},"url":"","checkStatusTaskStatus":0,"objects":{},"result":null,"parameters":
{"objectName":"","objectType":"GeoprocessingParameters","error":null,"objects":
{},"executionType":1,"inputs":{"Input_Observation_Point":
{"objectName":"","objectType":"GeoprocessingString","error":null,"objects":
{},"parameterType":9,"value":"
{OBJECTID:2067,comments:stupid}"}},"outputSpatialReference":null,
"processSpatialReference":null,"returnM":false,"returnZ":false}}
... View more
09-20-2019
06:37 AM
|
0
|
7
|
1579
|
|
POST
|
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)
... View more
09-20-2019
05:08 AM
|
0
|
0
|
2706
|
|
POST
|
I have a GP Service running and I can input values and it works great...running it manually on the server I just cant figure out how to call that Service from AppStudio and pass it the input parameters. I cant find an example anywhere....please help
... View more
09-19-2019
04:36 AM
|
0
|
0
|
1090
|
|
POST
|
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.
... View more
09-19-2019
04:35 AM
|
0
|
10
|
2706
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|