Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CoordinateTransformation{CoordinateType}" /> class.
 /// </summary>
 /// <param name="identifier">The identifier.</param>
 /// <param name="name">The name.</param>
 /// <param name="remarks">The remarks.</param>
 /// <param name="aliases">The aliases.</param>
 /// <param name="method">The coordinate operation method.</param>
 /// <param name="parameters">The parameters of the operation.</param>
 /// <param name="source">The source coordinate reference system.</param>
 /// <param name="target">The target coordinate reference system.</param>
 /// <param name="areaOfUse">The area of use.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The identifier is null.
 /// or
 /// The method is null.
 /// or
 /// The source coordinate reference system is null.
 /// or
 /// The target coordinate reference system is null.
 /// or
 /// The area of use is null.
 /// </exception>
 protected CoordinateTransformation(String identifier, String name, String remarks, String[] aliases,
                                    CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters,
                                    CoordinateReferenceSystem source, CoordinateReferenceSystem target, AreaOfUse areaOfUse)
     : base(identifier, name, remarks, aliases, method, parameters)
 {
     this.Source    = source ?? throw new ArgumentNullException(nameof(source));
     this.Target    = target ?? throw new ArgumentNullException(nameof(target));
     this.AreaOfUse = areaOfUse ?? throw new ArgumentNullException(nameof(areaOfUse));
 }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CoordinateOperation{SourceType, ResultType}" /> class.
        /// </summary>
        /// <param name="identifier">The identifier.</param>
        /// <param name="name">The name.</param>
        /// <param name="remarks">The remarks.</param>
        /// <param name="aliases">The aliases.</param>
        /// <param name="method">The coordinate operation method.</param>
        /// <param name="parameters">The parameters of the operation.</param>
        /// <exception cref="System.ArgumentNullException">
        /// The identifier is null.
        /// or
        /// The method is null.
        /// </exception>
        protected CoordinateOperation(String identifier, String name, String remarks, String[] aliases, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters)
            : base(identifier, name, remarks, aliases)
        {
            this.Method = method ?? throw new ArgumentNullException(nameof(method));

            if (parameters != null)
            {
                this.parameters = new Dictionary <CoordinateOperationParameter, Object>(method.Parameters.Count);

                // only keep the parameters which apply according to the method
                foreach (CoordinateOperationParameter parameter in parameters.Keys)
                {
                    if (method.Parameters.Contains(parameter))
                    {
                        this.parameters.Add(parameter, parameters[parameter]);
                    }
                }
            }
            else
            {
                this.parameters = new Dictionary <CoordinateOperationParameter, Object>();
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CoordinateProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier.</param>
        /// <param name="name">The name.</param>
        /// <param name="remarks">The remarks.</param>
        /// <param name="aliases">The aliases.</param>
        /// <param name="method">The coordinate operation method.</param>
        /// <param name="parameters">The parameters of the operation.</param>
        /// <param name="ellipsoid">The ellipsoid.</param>
        /// <param name="areaOfUse">The area of use where the operation is applicable.</param>
        /// <exception cref="System.ArgumentNullException">
        /// The identifier is null.
        /// or
        /// The method is null.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        public CoordinateProjection(String identifier, String name, String remarks, String[] aliases, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, remarks, aliases, method, parameters)
        {
            if (ellipsoid == null)
            {
                throw new ArgumentNullException(nameof(ellipsoid));
            }
            CoordinateOperationParameter[] parameterArray = this.Parameters.Keys.ToArray();

            // remeasure all length parameters to ellipsoid unit
            foreach (CoordinateOperationParameter parameter in parameterArray)
            {
                if ((this.Parameters[parameter] is Length) && ((Length)this.Parameters[parameter]).Unit != ellipsoid.SemiMajorAxis.Unit)
                {
                    this.SetParameterValue(parameter, ((Length)this.Parameters[parameter]).ToUnit(ellipsoid.SemiMajorAxis.Unit));
                }
            }

            this.AreaOfUse = areaOfUse ?? throw new ArgumentNullException(nameof(areaOfUse));
            this.Ellipsoid = ellipsoid;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CoordinateConversion{SourceType, ResultType}" /> class.
 /// </summary>
 /// <param name="identifier">The identifier.</param>
 /// <param name="name">The name.</param>
 /// <param name="remarks">The remarks.</param>
 /// <param name="aliases">The aliases.</param>
 /// <param name="method">The coordinate operation method.</param>
 /// <param name="parameters">The parameters of the operation.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The identifier is null.
 /// or
 /// The method is null.
 /// </exception>
 protected CoordinateConversion(String identifier, String name, String remarks, String[] aliases, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters)
     : base(identifier, name, remarks, aliases, method, parameters)
 {
 }