POST
|
I have problem defining arcpy.env.workspace in a separate module when publishing the script as a Geoprocessing Service on arcgis server. For instance: my main tool script: from myModule import myTool workspace = "Database Connections\\GEOP011@demma18.sde" tableName = "DEMMA18.MyTable" myTool.execute(workspace, tableName) myModule.myTool: import arcpy def execute(workspace, tableName) arcpy.env.workspace = workspace doSomething(tableName) def doSomething(tableName) with arcpy.da.SearchCursor(tableName, ["OBJECTID"]) as cursor: for row in cursor: print(row) When published to the server, this script will return error : cannot open DEMMA18.MyTable However, if I put the same code in a single .py file it runs on the server without error. Any Idea what is going wrong?
... View more
09-26-2016
10:00 AM
|
0
|
8
|
3687
|
IDEA
|
Thank you very much! I have ask in many forums and look in the documentation and I have never found that information. Do you know, in reverse, if it's possible to retrieve the token information from a username? For instance, get the list of active tokens for a perticular user or just knowing if a token is active for a user or not
... View more
09-22-2016
05:04 AM
|
0
|
0
|
692
|
IDEA
|
Let say you have a geoprocessing service made of a python script. This GP service is protected with token. It could be very useful to be able to retrieve the info of the user who made a request to this service. (username, fullname, role, email, etc...) With the token security, you can able or enable requests to a service, but in the GP service, different action could be made depending of the user who made the request. For instance, imagine a GP service that allow editing some fields values in a table. It would be nice if we could allow edits on perticular rows depending of the user. Without the information about the user, everyone who has a token can edit all the rows.
... View more
09-15-2016
06:31 AM
|
1
|
2
|
894
|
POST
|
I have published to arcgis server a python script that output a feature class. I would like to round coordinates of the REST output. I have tryed to use the XYResolution envrionement setting in the python script but it is ignored arcpy.env.XYResolution = "0 Meters" In the JSON output from the REST api, the geometry is not rounded like this "geometry": { "x": -7498445.5090999994, "y": 6161009.2334999964 }
Any idea why?
... View more
08-30-2016
07:34 AM
|
0
|
0
|
852
|
POST
|
After a long idle time (several hours), the Publisher returns the following errors: High Unresolved 00178 Data: C:\Windows\bfsvc.exe, used by Script Script cannot be copied to the server
... View more
07-28-2016
05:49 AM
|
0
|
0
|
953
|
POST
|
Ok I get it. It's true that it's not an onerous change. I wonder if the reason why arcgis is modifiying the script and the way modules are imported during the publish process is to ensure that if the script was made with python3 (arcgis pro), it will be compatible with python2.7 installed on arcgis server? I have opened a python console on the server and doing import urllib2 is working.
... View more
07-21-2016
07:55 AM
|
0
|
0
|
953
|
POST
|
I am not sure to understand your answer. I am using python 2.7 only, on server and on desktop, not python3.
... View more
07-21-2016
07:07 AM
|
0
|
2
|
953
|
POST
|
My organization just been equiped with ArcMap and ArcGIS Server and I already encountered problem when trying to publish python script as geoprocessing services when some python modules are imported Those problematic python modules I have encoutered so far are urllib2 and uuid If you do import urllib2 or import uuid , your script cannot published on the server, the publishing tool go idle and you have to kill the process. But, if you do from urllib2 import * or from uuid import * , your script can be published. This workaround can be problematic if classes or method in two modules have the same name. Is this a problem ESRI is aware of? Why those particular modules are causing this error?
... View more
07-20-2016
05:57 AM
|
0
|
6
|
2760
|
IDEA
|
I think something is wrong with your SDE, it takes me only 5-10 secondes to refresh the connection
... View more
07-20-2016
05:13 AM
|
0
|
1
|
406
|
IDEA
|
I think something is wrong with your SDE, it takes me only 5-10 secondes to refresh the connection
... View more
07-20-2016
05:13 AM
|
0
|
1
|
339
|
IDEA
|
Give the possibility to remove default value for geoprocessing services parameters
... View more
07-18-2016
11:38 AM
|
12
|
9
|
1743
|
POST
|
I have a geoprocessing service published on ArcGIS server 10.3 that is protected with tokens. This GP Service is a python script. Is it possible to retrieve the user information, such username and password, from inside the script using the token passed as parameter when executed? Is there a way with arcpy to retrieve user information from a valid token?
... View more
07-14-2016
06:34 AM
|
0
|
0
|
1134
|
POST
|
@Bill Daigle Thank you for your answer. Maybe you could help me a little further. I use a little python script at the end of my model builder to return the data in json format like that: import arcpy FC_In = arcpy.GetParameterAsText(0) feature_set = arcpy.FeatureSet() feature_set.load(FC_In) arcpy.AddMessage(feature_set.JSON) In the client I call the GP Service with ajax and I have noticed that the response contains two members { messages: [ ], results: [ ] } In the messages member I have the json data from my GP, but results is an empty array. Why does the results empty? Would not be better to pass the json data inside the results parameter instead of the messages parameter? How can I do that?
... View more
04-28-2016
11:50 AM
|
0
|
0
|
1600
|
POST
|
Is it a good practice to use the GP service message parameter to return json data as string when calling the GP from javascript client through REST? arcpy.AddMessage(json.dumps(data))
... View more
04-28-2016
09:51 AM
|
0
|
4
|
3611
|
POST
|
It's a shame that in 2016 ArcGIS cannot export a table to xlsx dirrectly!
... View more
04-22-2016
12:42 PM
|
0
|
0
|
713
|
Title | Kudos | Posted |
---|---|---|
1 | 08-30-2021 06:44 AM | |
1 | 08-30-2021 07:07 AM | |
1 | 08-30-2021 08:21 AM | |
1 | 11-28-2023 02:02 PM | |
1 | 12-04-2023 05:58 AM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|