Have you tried executing this task from the browser through the REST endpoint? Do you get your expected outfields there?
FeatureSet featureSet = new FeatureSet(graphicsToSerialize); featureSet.Fields = metroFLI.Fields; featureSet.GlobalIdFieldName = metroFLI.GlobalIdField; featureSet.ObjectIdFieldName = metroFLI.ObjectIdField; featureSet.DisplayFieldName = metroFLI.DisplayField; FeatureSet clipFeatureSet = new FeatureSet(GetExtentAsPolygon(_InterfaceFeatureExtent)); Geoprocessor gpTask = new Geoprocessor("http://myarcgisserver/ArcGIS/rest/services/Geoprocess/GPServer/Clip"); gpTask.JobCompleted += new EventHandler<JobInfoEventArgs>(gpTask_JobCompleted); gpTask.Failed += new EventHandler<TaskFailedEventArgs>(gpTask_Failed); List<GPParameter> gpParameters = new List<GPParameter>(); gpParameters.Add(new GPFeatureRecordSetLayer("Input_Features", featureSet)); gpParameters.Add(new GPFeatureRecordSetLayer("Clip_Features", clipFeatureSet)); gpTask.ProcessSpatialReference = _Map.SpatialReference; gpTask.OutputSpatialReference = _Map.SpatialReference; gpTask.SubmitJobAsync(gpParameters);
void gpTask_JobCompleted(object sender, JobInfoEventArgs e) { Geoprocessor gpTask = (Geoprocessor)sender as Geoprocessor; gpTask.GetResultDataCompleted += new EventHandler<GPParameterEventArgs>(gpTask_GetResultDataCompleted); gpTask.Failed += new EventHandler<TaskFailedEventArgs>(gpTaskGetResults_Failed); gpTask.GetResultDataAsync(e.JobInfo.JobId, "Output_Feature_Class", e.UserState); }
void gpTask_GetResultDataCompleted(object sender, GPParameterEventArgs e) { GPFeatureRecordSetLayer resultRecordSet = e.Parameter as GPFeatureRecordSetLayer; FeatureSet resultFeatureSet = resultRecordSet.FeatureSet; IList<Graphic> resultGraphics = resultFeatureSet.Features; }
We don't recommend input feature set without schema set when publishing the GP service; and rest input field definition has to match the defined schema otherwise the output will only have OBJECTID and geometry fields. But customer would like to publish schema less feature set input and input schema/field definition on the rest directory so the GP service will have a much wider use (to take different input schema, etc).
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.