Select to view content in your preferred language

geoprocessing tool output parameter

555
1
10-04-2013 12:04 AM
OndrejRenner
Deactivated User
Hello,
I have a python script which publish as a geoprocessing tool on ArcGIS Server 10.1.
Output of this script is object (Output class instance) of this structure:

class StatisticalParams:
    def __init__(self, type, min, max, std, mean, count):
        self.type = type
        self.min = min
        self.max = max
        self.std = std
        self.mean = mean
        self.count = count

class Feature:
    def __init__(self, fid, ftype, statisticalParams):
        self.fid = fid
        self.ftype = ftype
        self.statisticalParams = statisticalParams

class Output:
    def __init__(self, statisticalParam, features):
        self.statisticalParam = statisticalParam
        self.features = features


I do not know how I should set output parameter on ArcGIS Server (configuration of parameters of the script). In the script parameter is sets as
arcpy.SetParameter (1 outputParam)
.

Thanks for help.

Rendy
Tags (2)
0 Kudos
1 Reply
SchoppMatthieu
Deactivated User
Maybe you could convert it to json and then return it as string :

import json
outputJson = json.dumps(outputParam)
arcpy.SetParamter(outputJson )
0 Kudos