IDEA
|
My GP Service uses a security key parameter (string). This key is given as default value to anyone who knows the rest url in the submit job page. I have to try to input a fake key and modify it hard coded in Python when running the tool in AG, then modify the script back in the published service folder.
... View more
03-11-2020
09:51 AM
|
0
|
1
|
1427
|
POST
|
I have this problem with version 10.6. I was forced to use Duarte's work around to my popup to work. In 10.3 the script worked setting layer definitions when loading the map: var condicao = null; if (parseInt(numeroAia) > 0){ condicao = "idAuto = " + numeroAia; } else if(parseInt(ocorrenciaId) > 0){ condicao = "idOcorrencia = " + ocorrenciaId; if (tabAtiva.id.indexOf("tpAmbiente_tab") > 0) { condicao += " and idMFOA = " + meioFisicoId; } } var layerDef = []; layerDef[0] = condicao; layerDef[1] = condicao; Now is not enough to change layerDef format to json in the beggining, I had to change it on the click event to override identifyParams.layerDefinitions: var executeIdentifyTask = function (evt) { var layerDef2 = { "0": condicao, "1": condicao }; identifyParams.layerDefinitions = layerDef2; identifyParams.geometry = evt.mapPoint; identifyParams.mapExtent = mapa.extent; var deferred = identifyTask .execute(identifyParams) Because once set identifyParams.layerDefinitions, it is not in json format anymore.
... View more
08-20-2019
07:28 AM
|
0
|
0
|
492
|
POST
|
Thank you, to add the <system.web> <httpRuntime executionTimeout="100000" maxRequestLength="214748364" /> </system.web> section to the Web.config of my dotnet proxy resolved my attachment size limit (ArcGIS enterprise/portal).
... View more
04-05-2019
09:21 AM
|
0
|
0
|
848
|
POST
|
Well, I feel the duty of warn those trying to use a widget in a WAB template to add a feature and attach a file to it: DO NOT try it with a python toolbox/geoprocessing service. Based on my ill fated experience, it is a HUGE headache compared to JS API. The time spent on trying it was 83 hours against 25 hours in JS API (done). Just use // post que envia feicao $.post(urlAF, { features: JSON.stringify([feature]), f: "json" }) .done(lang.hitch(this, function (results) {//post bem-sucedido console.log(results); dom.byId('upload-status').innerHTML = '<p style="color:green">Ponto criado. Adicionando anexo.</p>'; // timeout para aguardar results preenchidos e entao anexar arquivo setTimeout(function () { // converte json de resposta em objeto js var resultAF = JSON.parse(results); // converte em integer o objectId oid = parseInt(resultAF.addResults[0].objectId); // Trecho que adiciona anexo se insercao do ponto foi bem-sucedida var featureLayer = new esri.layers.FeatureLayer(url, { outFields: ["*"], visible: false }); featureLayer.addAttachment(oid, document.getElementById("uploadForm"), callback, function (err) { console.log(err);//addAttachment falhou dom.byId('upload-status').innerHTML = '<p style="color:red">Erro ao anexar foto. Informe a equipe do SigamGeo.</p>'; }); function callback(result) {//addAttachment bem-sucedido console.log(result); dom.byId('upload-status').innerHTML = '<p style="color:green">Ponto criado e foto anexada.</p>'; }; }, 100); })) .fail(function (error) {//post falhou console.log(error); dom.byId('upload-status').innerHTML = '<p style="color:red">Erro na criacao do ponto. Tente novamente ou informe equipe do SigamGeo.</p>'; });
... View more
04-03-2019
12:03 PM
|
0
|
0
|
446
|
POST
|
The same user who made this question has a sample of code: https://community.esri.com/thread/211943-invalid-url-error-for-geoprocessing-service
... View more
03-27-2019
10:51 AM
|
0
|
0
|
3285
|
POST
|
Did you solve your problem? My getparameter is receiving none after I pass the itemID.
... View more
03-27-2019
10:10 AM
|
0
|
1
|
3285
|
POST
|
I'm building a widget in a WAB template that sends a geotagged photo to a Python toolbox GP service to create a point with the coordinates and attach the photo. I send the request to upload: var requestID = request({ url: "sampleurl", content: { f: "pjson" }, form: dojo.byId("uploadForm"), handleAs: "json" }); Receive a successful response: Upload Success: {success: true, item: {…}, _ssl: undefined} item: committed: true date: 1553539769324 description: null itemID: "i697e97a0-7caa-4bac-9a5f-6e3da8ae8249" itemName: "P_20190312_104511_gps_lig.jpg" serviceName: "DEMO/UploadPhotoGeo.GPServer" __proto__: Object success: true _ssl: undefined __proto__: Object Then I get the itemID and set the parameters and submit job: requestID.then( function (response) { console.log("Upload Success: ", response); itemID = response.item.itemID; nomeItem = response.item.itemName; params = { "in_x": String(x_decimal), "in_y": String(y_decimal), "in_z": String(z.valueOf()), "in_NIS": null, "in_idProcDet": null, "in_obs": null, "in_upDate": null, "in_photoDate": fulldate, "in_or": null, "in_owner": null, "in_att": itemID, "in_fn": nomeItem }; var gpJob = gpTask.submitJob(params, completeCallback, statusCallback); gpJob.then( function (response) { console.log("GP Success: ", response); }, function (error) { console.log("GP Error: ", error.message); }); In my Python toolbox, this specific parameter is defined as: # Eleventh parameter - Attachment param10 = arcpy.Parameter( displayName="Input Attachment", name="in_att", datatype="GPDataFile", parameterType="Optional", direction="Input") And retrieved here: foto = parameters[10].valueAsText fotoNome = parameters[11].valueAsText arcpy.AddMessage(str(foto)) if (foto <> None): arcpy.AddMessage('Foto: ' + str(foto)) But I am receiving a message of a null parameter: 8: description: "Foto: None" type: "esriJobMessageTypeInformative" __proto__: Object And the script does not create the point or save the photo: 14: description: "Gravando foto no drive f: must be string or buffer, not None" type: "esriJobMessageTypeInformative" Am I missing something?
... View more
03-26-2019
06:13 AM
|
0
|
1
|
585
|
POST
|
I have a very similar problem, but the script works when running alone, it has the exactly behavior as yours when running inside a python tool box. Reading your explanation about get it done with gdb at least give me some hope, thanks. But I am very frustrated with the impossibility of using a sde connection correctly, probably I have to change my map service to a gdb now, instead of my microsoft sql table. Somebody knows if it is a reported bug (I'm using 10.3.1) or we are just missing something?
... View more
03-22-2019
01:50 PM
|
0
|
0
|
966
|
POST
|
Thanks, I had exactly the same problem, my first time using geoprocessor and documentation does not make clear that you need add the tool name to the url.
... View more
03-21-2019
10:17 AM
|
0
|
0
|
1778
|
POST
|
I was thinking the same, I use ArcGIS Enterprise 10.3.1, and already used a GPtool to create a widget to extract data (export in kml, shp, etc). But now I have to load photos with geotag from the app/template, so I created a widget with a exif.js dependency to read the x,y,z of a photo and was thinking to use arcpy to generate the point and add the attachment.
... View more
03-14-2019
05:46 AM
|
0
|
0
|
1011
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|