private void PerformDoD(Epoch DoDEpoch, ThresholdProps tProps)
        {
            DEMSurvey NewDEM  = DoDEpoch.NewDEM;
            DEMSurvey OldDEM  = DoDEpoch.OldDEM;
            string    aoiName = AOIMask is Project.Masks.AOIMask ? AOIMask.Name : string.Empty;

            string dodName = frmDoDProperties.GetUniqueAnalysisName(NewDEM.Name, OldDEM.Name, tProps.ThresholdString, aoiName);

            System.IO.DirectoryInfo dFolder = ProjectManager.Project.GetDoDFolder();

            ChangeDetectionEngineBase cdEngine = null;

            switch (tProps.Method)
            {
            case ThresholdProps.ThresholdMethods.MinLoD:
                cdEngine = new ChangeDetectionEngineMinLoD(NewDEM, OldDEM, AOIMask, tProps.Threshold, true);
                break;

            case ThresholdProps.ThresholdMethods.Propagated:
                cdEngine = new ChangeDetectionEnginePropProb(NewDEM, OldDEM, DoDEpoch.NewDEMErrorSurface, DoDEpoch.OldDEMErrorSurface, AOIMask, true);
                break;

            case ThresholdProps.ThresholdMethods.Probabilistic:
                cdEngine = new ChangeDetectionEngineProbabilistic(NewDEM, OldDEM, AOIMask, DoDEpoch.NewDEMErrorSurface, DoDEpoch.OldDEMErrorSurface, tProps.Threshold, tProps.SpatialCoherenceProps, true);
                break;
            }

            DoDBase dod = cdEngine.Calculate(dodName, dFolder, true, ProjectManager.Project.Units);

            ProjectManager.Project.DoDs.Add(dod);
        }
Exemplo n.º 2
0
        private void PerformDoD(BatchProps props)
        {
            string aoiName = props.AOIMask is Project.Masks.AOIMask ? props.AOIMask.Name : string.Empty;
            string dodName = frmDoDProperties.GetUniqueAnalysisName(props.NewSurface.Name, props.OldSurface.Name, props.ThresholdProps.ThresholdString, aoiName);

            System.IO.DirectoryInfo dFolder = ProjectManager.Project.GetDoDFolder();

            ChangeDetectionEngineBase cdEngine = null;

            switch (props.ThresholdProps.Method)
            {
            case ThresholdProps.ThresholdMethods.MinLoD:
                cdEngine = new ChangeDetectionEngineMinLoD(props.NewSurface, props.OldSurface, props.AOIMask, props.ThresholdProps.Threshold, true);
                break;

            case ThresholdProps.ThresholdMethods.Propagated:
                cdEngine = new ChangeDetectionEnginePropProb(props.NewSurface, props.OldSurface, props.NewError, props.OldError, props.AOIMask, true);
                break;

            case ThresholdProps.ThresholdMethods.Probabilistic:
                cdEngine = new ChangeDetectionEngineProbabilistic(props.NewSurface, props.OldSurface, props.AOIMask, props.NewError, props.OldError,
                                                                  props.ThresholdProps.Threshold, props.ThresholdProps.SpatialCoherenceProps, true);
                break;
            }

            DoDBase dod = cdEngine.Calculate(dodName, dFolder, true, ProjectManager.Project.Units);

            ProjectManager.Project.DoDs.Add(dod);
        }