/// <summary> /// Initializes a new instance of the <see cref="ClassificationChangeDetection{TResult}" /> class. /// </summary> /// <param name="source">The source.</param> /// <param name="operationMethod">The method.</param> /// <param name="parameters">The parameters.</param> /// <exception cref="System.ArgumentNullException"> /// The source is null. /// or /// The method is null. /// or /// The method requires parameters which are not specified. /// </exception> /// <exception cref="System.ArgumentException"> /// The source is invalid. /// or /// The target is invalid. /// or /// The specified source and result are the same objects, but the method does not support in-place operations. /// or /// The parameters do not contain a required parameter value. /// or /// The type of a parameter does not match the type specified by the method. /// or /// A parameter value does not satisfy the conditions of the parameter. /// </exception> protected ClassificationChangeDetection(ISpectralGeometry source, OperationMethod operationMethod, IDictionary <OperationParameter, Object> parameters) : base(source, default(TResult), operationMethod, parameters) { ISpectralGeometry reference = ResolveParameter <ISpectralGeometry>(SpectralOperationParameters.ClassificationReferenceGeometry); if (source.Raster == null) { throw new ArgumentException("The source geometry does not contain a raster image.", nameof(source)); } if (source.Raster.NumberOfBands != 1) { throw new ArgumentException("The source geometry does not contain a single band.", nameof(source)); } if (reference.Raster == null) { throw new ArgumentException("The reference geometry does not contain a raster image.", nameof(parameters)); } if (reference.Raster.NumberOfBands != 1) { throw new ArgumentException("The reference geometry does not contain a single band.", nameof(parameters)); } AreMatchingRasters = RasterAlgorithms.IsMatching(source.Raster, reference.Raster); Reference = reference; }
/// <summary> /// Computes the result of the operation. /// </summary> protected override void ComputeResult() { if (RasterAlgorithms.IsMatching(Source.Raster, _validationGeometry.Raster)) { MatchByIndices(); } else if (_validationGeometry.Raster.IsMapped && Source.Raster.IsMapped) { MatchByLocation(); } }
/// <summary> /// Initializes a new instance of the <see cref="ClassificationMapValidation" /> class. /// </summary> /// <param name="source">The source.</param> /// <param name="parameters">The parameters.</param> /// <exception cref="System.ArgumentNullException">The source is null.</exception> /// <exception cref="System.ArgumentException"> /// The source is invalid. /// or /// The parameters do not contain a required parameter value. /// or /// The type of a parameter does not match the type specified by the method. /// or /// A parameter value does not satisfy the conditions of the parameter. /// </exception> public ClassificationMapValidation(ISpectralGeometry source, IDictionary <OperationParameter, Object> parameters) : base(source, null, SpectralOperationMethods.ClassificationMapValidation, parameters) { _validationGeometry = ResolveParameter <ISpectralGeometry>(SpectralOperationParameters.ClassificationValidationGeometry); _isValidationMatching = RasterAlgorithms.IsMatching(Source.Raster, _validationGeometry.Raster); }