コード例 #1
0
 /// <summary>
 /// Runnings generic geoprocess passed from FireGeoprocessingTools static class.
 /// </summary>
 /// <param name="inGPObj">In geoprocessing object to run.</param>
 /// <param name="workspacePath">Workspace path to use</param>
 /// <param name="overwriteOutput">bool set to true if output is to be overwritten</param>
 private void RunGeoprocess(ref IGPProcess inGPObj, string workspacePath, bool overwriteOutput = true)
 {
     using (FeatureProcessingFactory featureProcessing = new FeatureProcessingFactory(workspacePath, overwriteOutput))
     {
         RaiseLogEvent($"Running {inGPObj.ToolName}");
         featureProcessing.OnProcessChangedEvent   += base.RaiseProcessChangedEvent;
         featureProcessing.OnProcessExceptionEvent += this.RaiseExceptionEvent;
         featureProcessing.RunGeoprocessingOperation(inGPObj);
         featureProcessing.OnProcessChangedEvent   -= base.RaiseProcessChangedEvent;
         featureProcessing.OnProcessExceptionEvent -= this.RaiseExceptionEvent;
     }
 }
コード例 #2
0
 /// <summary>
 /// Runnings generic geoprocess passed from FireGeoprocessingTools static class.
 /// </summary>
 /// <param name="inGPObj">In geoprocessing object to run.</param>
 /// <param name="workspacePath">Workspace path to use</param>
 /// <param name="returnIdx">index of return object.</param>
 /// <param name="overwriteOutput">bool set to true if output is to be overwritten</param>
 /// <param name="result">IFeatureClass object returned from GPOperation</param>
 private void RunGeoprocess(ref IGPProcess inGPObj, string workspacePath, bool overwriteOutput, int returnIdx, out IFeatureClass result)
 {
     using (FeatureProcessingFactory featureProcessing = new FeatureProcessingFactory(workspacePath, overwriteOutput))
     {
         RaiseLogEvent($"Running {inGPObj.ToolName}");
         featureProcessing.OnProcessChangedEvent   += base.RaiseProcessChangedEvent;
         featureProcessing.OnProcessExceptionEvent += this.RaiseExceptionEvent;
         featureProcessing.RunGeoprocessingOperation(inGPObj);
         result = featureProcessing.GPResultToFeatureClass(returnIdx);
         featureProcessing.OnProcessChangedEvent   -= base.RaiseProcessChangedEvent;
         featureProcessing.OnProcessExceptionEvent -= this.RaiseExceptionEvent;
     }
 }