Trying to run geoprocessing tool against service on portal...

12-16-2019 07:54 AM
Occasional Contributor

I'm not quite sure where this should go, so cross posting.

We have an on premise portal with a feature service published.  We're trying to write a python script that will run a geoprocessing tool against this service.  Right now it's extremely simple; authenticate to portal, look at the service, and run arcpy.Statistics_analysis against it.  All we want to do is get an output table of statistics. Now, if I do this in python directly against the database, no problems.  But when running it against the service... it SEES the service, but it fails on the analysis.  Can anyone help??

def run(self):

lines = arcpy.SearchCursor(

for line in lines:

stats_table = "C:/temp/services_test.gdb/stats_out"
stat = [["st_length", "SUM"]]

arcpy.Statistics_analysis(lines, stats_table, stat)

0 Kudos
0 Replies