/// <summary>
        /// Initializes a new instance of the <see cref="CoordinateProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method requires parameters which are not specified.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        public CoordinateProjection(String identifier, String name, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters)
        {
            if (ellipsoid == null)
            {
                throw new ArgumentNullException("ellipsoid", "The ellipsoid is null.");
            }

            if (areaOfUse == null)
            {
                throw new ArgumentNullException("areaOfUse", "The area of use is null.");
            }

            if (parameters != null)
            {
                foreach (CoordinateOperationParameter parameter in parameters.Keys)
                {
                    if ((parameters[parameter] is Length) && ((Length)parameters[parameter]).Unit != ellipsoid.SemiMajorAxis.Unit)
                    {
                        throw new ArgumentException("The parameter '" + parameter.Name + "' does not have the same measurement unit as the ellipsoid.", "parameters");
                    }
                }
            }

            _areaOfUse = areaOfUse;
            _ellipsoid = ellipsoid;
        }
        /// <summary>
        /// Returns all <see cref="GeographicTransformation" /> instances matching a specified method.
        /// </summary>
        /// <param name="method">The method.</param>
        /// <returns>A read-only list containing the <see cref="GeographicTransformation" /> instances that match the specified method.</returns>
        public static IList <GeographicTransformation> FromMethod(CoordinateOperationMethod method)
        {
            if (method == null)
            {
                return(null);
            }

            return(All.Where(obj => obj.Method.Equals(method)).ToList().AsReadOnly());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GridProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</param>
        /// <param name="method">The coordinate operation method.</param>
        /// <param name="areaOfUse">The area of use where the operation is applicable.</param>
        /// <exception cref="System.ArgumentNullException">The area of use is null.</exception>
        public GridProjection(String identifier, String name, CoordinateOperationMethod method, AreaOfUse areaOfUse)
            : base(identifier, name, method, null)
        {
            if (areaOfUse == null)
            {
                throw new ArgumentNullException("areaOfUse", "The area of use is null.");
            }

            _areaOfUse = areaOfUse;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="BonneProjection"/> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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>
        protected BonneProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            _falseEasting             = ((Length)_parameters[CoordinateOperationParameters.FalseEasting]).Value;
            _falseNorthing            = ((Length)_parameters[CoordinateOperationParameters.FalseNorthing]).Value;
            _latitudeOfNaturalOrigin  = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOfNaturalOrigin]).BaseValue;
            _longitudeOfNaturalOrigin = ((Angle)_parameters[CoordinateOperationParameters.LongitudeOfNaturalOrigin]).BaseValue;

            _e4 = Calculator.Pow(_ellipsoid.Eccentricity, 4);
            _e6 = Calculator.Pow(_ellipsoid.Eccentricity, 6);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TransformEquidistantCylindricalProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method is null.
        /// or
        /// The method requires parameters which are not specified.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected EquidistantCylindricalProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            // source: EPSG Guidance Note number 7, part 2, page 76

            _latitudeOf1stStadardParallel = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOf1stStandardParallel]).BaseValue;
            _longitudeOfNaturalOrigin     = ((Angle)_parameters[CoordinateOperationParameters.LongitudeOfNaturalOrigin]).BaseValue;
            _falseEasting  = ((Length)_parameters[CoordinateOperationParameters.FalseEasting]).Value;
            _falseNorthing = ((Length)_parameters[CoordinateOperationParameters.FalseNorthing]).Value;

            _nu1 = _ellipsoid.SemiMajorAxis.Value / Math.Sqrt(1 - _ellipsoid.EccentricitySquare * Calculator.Sin2(_latitudeOf1stStadardParallel));
        }
示例#6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ObliqueMercatorProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 defined operation method requires parameters.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected ObliqueMercatorProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            // source: EPSG Guidance Note number 7, part 2, page 56

            _latitudeOfProjectionCentre  = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOfProjectionCentre]).BaseValue;
            _longitudeOfProjectionCentre = ((Angle)_parameters[CoordinateOperationParameters.LongitudeOfProjectionCentre]).BaseValue;
            _scaleFactorOnInitialLine    = (Double)_parameters[CoordinateOperationParameters.ScaleFactorOnInitialLine];
            _azimuthOfInitialLine        = ((Angle)_parameters[CoordinateOperationParameters.AzimuthOfInitialLine]).BaseValue;

            _b = Math.Sqrt(1 + (_ellipsoid.EccentricitySquare * Calculator.Cos4(_latitudeOfProjectionCentre) / (1 - _ellipsoid.EccentricitySquare)));
        }
示例#7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HelmertTransformation" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</param>
        /// <param name="method">The coordinate operation method.</param>
        /// <param name="parameters">The parameters of the operation.</param>
        /// <exception cref="System.ArgumentNullException">
        /// The method is null.
        /// or
        /// The method requires parameters which are not specified.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// </exception>
        protected HelmertTransformation(String identifier, String name, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters)
            : base(identifier, name, method, parameters)
        {
            _xAxisTranslation = ((Length)_parameters[CoordinateOperationParameters.XAxisTranslation]).BaseValue;
            _yAxisTranslation = ((Length)_parameters[CoordinateOperationParameters.YAxisTranslation]).BaseValue;
            _zAxisTranslation = ((Length)_parameters[CoordinateOperationParameters.ZAxisTranslation]).BaseValue;
            _xAxisRotation    = ((Angle)_parameters[CoordinateOperationParameters.XAxisRotation]).BaseValue;
            _yAxisRotation    = ((Angle)_parameters[CoordinateOperationParameters.YAxisRotation]).BaseValue;
            _zAxisRotation    = ((Angle)_parameters[CoordinateOperationParameters.ZAxisRotation]).BaseValue;
            _scaleDifference  = Convert.ToDouble(_parameters[CoordinateOperationParameters.ScaleDifference]);

            _m = 1 + _scaleDifference * 1E-6;
        }
示例#8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SeismicBinGridTransformation" /> class.
        /// </summary>
        /// <param name="identifier">The identifier.</param>
        /// <param name="name">The name.</param>
        /// <param name="method">The coordinate operation method.</param>
        /// <param name="parameters">The parameters of the operation.</param>
        /// <exception cref="System.ArgumentNullException">
        /// The method is null.
        /// or
        /// The method requires parameters which are not specified.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// </exception>
        protected P6SeismicBinGridTransformation(String identifier, String name, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters)
            : base(identifier, name, method, parameters)
        {
            // EPSG Guidance Note number 7, part 2, page 112

            _binGridOriginI               = Convert.ToDouble(_parameters[CoordinateOperationParameters.BinGridOriginI]);
            _binGridOriginJ               = Convert.ToDouble(_parameters[CoordinateOperationParameters.BinGridOriginJ]);
            _binGridOriginEasting         = ((Length)_parameters[CoordinateOperationParameters.BinGridOriginEasting]).BaseValue;
            _binGridOriginNorthing        = ((Length)_parameters[CoordinateOperationParameters.BinGridOriginNorthing]).BaseValue;
            _scaleFactorOfBinGrid         = Convert.ToDouble(_parameters[CoordinateOperationParameters.ScaleFactorOfBinGrid]);
            _binWidthOnIAxis              = ((Length)_parameters[CoordinateOperationParameters.BinWidthOnIAxis]).BaseValue;
            _binWidthOnJAxis              = ((Length)_parameters[CoordinateOperationParameters.BinWidthOnJAxis]).BaseValue;
            _mapGridBearingOfBinGridJAxis = ((Angle)_parameters[CoordinateOperationParameters.MapGridBearingOfBinGridJAxis]).BaseValue;
            _binNodeIncOnIAxis            = Convert.ToDouble(_parameters[CoordinateOperationParameters.BinNodeIncrementOnIAxis]);
            _binNodeIncOnJAxis            = Convert.ToDouble(_parameters[CoordinateOperationParameters.BinNodeIncrementOnJAxis]);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LambertConicConformal1SPProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method is null.
        /// or
        /// The defined operation method requires parameters.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected LambertConicConformal1SPProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            _latitudeOfNaturalOrigin    = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOfNaturalOrigin]).BaseValue;
            _longitudeOfNaturalOrigin   = ((Angle)_parameters[CoordinateOperationParameters.LongitudeOfNaturalOrigin]).BaseValue;
            _scaleFactorAtNaturalOrigin = Convert.ToDouble(_parameters[CoordinateOperationParameters.ScaleFactorAtNaturalOrigin]);
            _falseEasting  = ((Length)_parameters[CoordinateOperationParameters.FalseEasting]).Value;
            _falseNorthing = ((Length)_parameters[CoordinateOperationParameters.FalseNorthing]).Value;

            // source: EPSG Guidance Note number 7, part 2, page 18

            Double m0 = Math.Cos(_latitudeOfNaturalOrigin) / Math.Sqrt(1 - _ellipsoid.EccentricitySquare * Calculator.Sin2(_latitudeOfNaturalOrigin));
            Double t0 = ComputeTValue(_latitudeOfNaturalOrigin);

            _n  = Math.Sin(_latitudeOfNaturalOrigin);
            _f  = m0 / (_n * Math.Pow(t0, _n));
            _r0 = _ellipsoid.SemiMajorAxis.Value * _f * Math.Pow(t0, _n) * _scaleFactorAtNaturalOrigin;
        }
示例#10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="KrovakModifiedProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method is null.
        /// or
        /// The method requires parameters which are not specified.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected KrovakModifiedProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            // source: EPSG Guidance Note number 7, part 2, page 29

            _ordinate1OfEvaluationPoint = ((Length)_parameters[CoordinateOperationParameters.Ordinate1OfEvaluationPoint]).BaseValue;
            _ordinate2OfEvaluationPoint = ((Length)_parameters[CoordinateOperationParameters.Ordinate2OfEvaluationPoint]).BaseValue;
            _C1  = Convert.ToDouble(_parameters[CoordinateOperationParameters.C1]);
            _C2  = Convert.ToDouble(_parameters[CoordinateOperationParameters.C2]);
            _C3  = Convert.ToDouble(_parameters[CoordinateOperationParameters.C3]);
            _C4  = Convert.ToDouble(_parameters[CoordinateOperationParameters.C4]);
            _C5  = Convert.ToDouble(_parameters[CoordinateOperationParameters.C5]);
            _C6  = Convert.ToDouble(_parameters[CoordinateOperationParameters.C6]);
            _C7  = Convert.ToDouble(_parameters[CoordinateOperationParameters.C7]);
            _C8  = Convert.ToDouble(_parameters[CoordinateOperationParameters.C8]);
            _C9  = Convert.ToDouble(_parameters[CoordinateOperationParameters.C9]);
            _C10 = Convert.ToDouble(_parameters[CoordinateOperationParameters.C10]);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CassiniSoldnerProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method is null.
        /// or
        /// The defined operation method requires parameters.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected CassiniSoldnerProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            // source: EPSG Guidance Note number 7, part 2, page 40

            _latitudeOfNaturalOrigin  = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOfNaturalOrigin]).BaseValue;
            _longitudeOfNaturalOrigin = ((Angle)_parameters[CoordinateOperationParameters.LongitudeOfNaturalOrigin]).BaseValue;
            _falseEasting             = ((Length)_parameters[CoordinateOperationParameters.FalseEasting]).Value;
            _falseNorthing            = ((Length)_parameters[CoordinateOperationParameters.FalseNorthing]).Value;

            _e2 = Calculator.Pow(_ellipsoid.Eccentricity, 2);
            _e4 = Calculator.Pow(_ellipsoid.Eccentricity, 4);
            _e6 = Calculator.Pow(_ellipsoid.Eccentricity, 6);
            _e8 = Calculator.Pow(_ellipsoid.Eccentricity, 8);
            _M0 = _ellipsoid.SemiMajorAxis.Value * ((1 - _e2 / 4 - 3 * _e4 / 64 - 5 * _e6 / 256) * _latitudeOfNaturalOrigin -
                                                    (3 * _e2 / 8 + 3 * _e4 / 32 + 45 * _e6 / 1024) * Math.Sin(2 * _latitudeOfNaturalOrigin) +
                                                    (15 * _e4 / 256 + 45 * _e6 / 1024) * Math.Sin(4 * _latitudeOfNaturalOrigin) -
                                                    35 * _e6 / 3072 * Math.Sin(6 * _latitudeOfNaturalOrigin));
        }
        protected Double _ellipsoidRadius; // projection constant

        #endregion Protected fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="MercatorProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method is null.
        /// or
        /// The defined operation method requires parameters.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected MercatorProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            // source: EPSG Guidance Note number 7, part 2, page 34

            _longitudeOfNaturalOrigin = ((Angle)_parameters[CoordinateOperationParameters.LongitudeOfNaturalOrigin]).BaseValue;
            _falseEasting             = ((Length)_parameters[CoordinateOperationParameters.FalseEasting]).Value;
            _falseNorthing            = ((Length)_parameters[CoordinateOperationParameters.FalseNorthing]).Value;

            _ellipsoidRadius = _ellipsoid.SemiMajorAxis.Value;

            _inverseParams = new Double[]
            {
                (_ellipsoid.EccentricitySquare / 2 + 5 * Calculator.Pow(_ellipsoid.Eccentricity, 4) / 24 + Calculator.Pow(_ellipsoid.Eccentricity, 6) / 12 + 13 * Calculator.Pow(_ellipsoid.Eccentricity, 8) / 360),
                (7 * Calculator.Pow(_ellipsoid.Eccentricity, 4) / 48 + 29 * Calculator.Pow(_ellipsoid.Eccentricity, 6) / 240 + 811 * Calculator.Pow(_ellipsoid.Eccentricity, 8) / 11520),
                (7 * Calculator.Pow(_ellipsoid.Eccentricity, 6) / 120 + 81 * Calculator.Pow(_ellipsoid.Eccentricity, 8) / 1120),
                4279 * Calculator.Pow(_ellipsoid.Eccentricity, 8) / 161280
            };
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GeographicTransformation" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method requires parameters which are not specified.
        /// or
        /// The source coordinate reference system is null.
        /// or
        /// The target coordinate reference system is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected GeographicTransformation(String identifier, String name, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters, CoordinateReferenceSystem source, CoordinateReferenceSystem target, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source", "The source coordinate reference system is null.");
            }
            if (target == null)
            {
                throw new ArgumentNullException("target", "The target coordinate reference system is null.");
            }
            if (areaOfUse == null)
            {
                throw new ArgumentNullException("areaOfUse", "The area of use is null.");
            }

            _source    = source;
            _target    = target;
            _areaOfUse = areaOfUse;
        }
示例#14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="KrovakProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method is null.
        /// or
        /// The method requires parameters which are not specified.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected KrovakProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            // source: EPSG Guidance Note number 7, part 2, page 25

            _latitudeOfProjectionCentre          = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOfProjectionCentre]).BaseValue;
            _longitudeOfOrigin                   = ((Angle)_parameters[CoordinateOperationParameters.LongitudeOfOrigin]).BaseValue;
            _coLatitudeOfConeAxis                = ((Angle)_parameters[CoordinateOperationParameters.CoLatitudeOfConeAxis]).BaseValue;
            _latitudeOfPseudoStandardParallel    = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOfPseudoStandardParallel]).BaseValue;
            _scaleFactorOnPseudoStandardParallel = Convert.ToDouble(_parameters[CoordinateOperationParameters.ScaleFactorOnPseudoStandardParallel]);
            _falseEasting  = ((Length)_parameters[CoordinateOperationParameters.FalseEasting]).BaseValue;
            _falseNorthing = ((Length)_parameters[CoordinateOperationParameters.FalseNorthing]).BaseValue;

            _A      = (_ellipsoid.SemiMajorAxis.BaseValue * Math.Pow((1 - _ellipsoid.EccentricitySquare), 0.5)) / (1 - _ellipsoid.EccentricitySquare * Calculator.Sin2(_latitudeOfProjectionCentre));
            _B      = Math.Pow(1 + ((_ellipsoid.EccentricitySquare * Calculator.Cos4(_latitudeOfProjectionCentre)) / (1 - _ellipsoid.EccentricitySquare)), 0.5);
            _gammaO = Math.Asin(Math.Sin(_latitudeOfProjectionCentre) / _B);
            _tO     = Math.Tan((Math.PI / 4) + (_gammaO / 2)) * (Math.Pow((1 + _ellipsoid.Eccentricity * Math.Sin(_latitudeOfProjectionCentre)) / (1 - _ellipsoid.Eccentricity * Math.Sin(_latitudeOfProjectionCentre)), _ellipsoid.Eccentricity * _B / 2)) / Math.Pow(Math.Tan(Math.PI / 4 + _latitudeOfProjectionCentre / 2), _B);
            _n      = Math.Sin(_latitudeOfPseudoStandardParallel);
            _rO     = (_scaleFactorOnPseudoStandardParallel * _A) / (Math.Tan(_latitudeOfPseudoStandardParallel));
        }
        /// <summary>
        /// Returns the <see cref="GeocentricTransformation" /> instance for the specified method.
        /// </summary>
        /// <param name="method">The method.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>The <see cref="GeocentricTransformation" /> instance implementing the method.</returns>
        /// <exception cref="System.ArgumentNullException">The method is null.</exception>
        public static GeocentricTransformation FromMethod(CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method", "The method is null.");
            }

            if (_operations == null)
            {
                LoadOperations();
            }

            if (!_operations.ContainsKey(method))
            {
                return(null);
            }

            // create instance
            return(Activator.CreateInstance(_operations[method], method.Identifier, method.Name, parameters) as GeocentricTransformation);
        }
示例#16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LambertConicConformal2SPProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method is null.
        /// or
        /// The defined operation method requires parameters.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected LambertConicConformal2SPProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            // source: EPSG Guidance Note number 7, part 2, page 18

            _latitudeOfFalseOrigin         = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOfFalseOrigin]).BaseValue;
            _longitudeOfFalseOrigin        = ((Angle)_parameters[CoordinateOperationParameters.LongitudeOfFalseOrigin]).BaseValue;
            _latitudeOf1stStandardParallel = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOf1stStandardParallel]).BaseValue;
            _latitudeOf2ndStandardParallel = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOf2ndStandardParallel]).BaseValue;
            _eastingAtFalseOrigin          = ((Length)_parameters[CoordinateOperationParameters.EastingAtFalseOrigin]).Value;
            _northingAtFalseOrigin         = ((Length)_parameters[CoordinateOperationParameters.NorthingAtFalseOrigin]).Value;

            Double m1 = Math.Cos(_latitudeOf1stStandardParallel) / Math.Sqrt(1 - _ellipsoid.EccentricitySquare * Calculator.Sin2(_latitudeOf1stStandardParallel));
            Double m2 = Math.Cos(_latitudeOf2ndStandardParallel) / Math.Sqrt(1 - _ellipsoid.EccentricitySquare * Calculator.Sin2(_latitudeOf2ndStandardParallel));
            Double t1 = ComputeTValue(_latitudeOf1stStandardParallel);
            Double t2 = ComputeTValue(_latitudeOf2ndStandardParallel);
            Double tF = ComputeTValue(_latitudeOfFalseOrigin);

            _n  = (Math.Log(m1) - Math.Log(m2)) / (Math.Log(t1) - Math.Log(t2));
            _f  = m1 / (_n * Math.Pow(t1, _n));
            _rF = _ellipsoid.SemiMajorAxis.Value * _f * Math.Pow(tF, _n);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="HotineObliqueMercatorProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 defined operation method requires parameters.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected HotineObliqueMercatorProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            // source: EPSG Guidance Note number 7, part 2, page 56
            _angleFromRectifiedToSkewGrid = ((Angle)_parameters[CoordinateOperationParameters.AngleFromRectifiedToSkewGrid]).BaseValue;

            _a = _ellipsoid.SemiMajorAxis.Value * _b * _scaleFactorOnInitialLine * Math.Sqrt(1 - _ellipsoid.EccentricitySquare) / (1 - _ellipsoid.EccentricitySquare * Calculator.Sin2(_latitudeOfProjectionCentre));
            Double tO = Math.Tan(Constants.PI / 4 - _latitudeOfProjectionCentre / 2) / Math.Pow((1 - _ellipsoid.Eccentricity * Math.Sin(_latitudeOfProjectionCentre)) / (1 + _ellipsoid.Eccentricity * Math.Sin(_latitudeOfProjectionCentre)), _ellipsoid.Eccentricity / 2);
            Double d  = _b * Math.Sqrt(1 - _ellipsoid.EccentricitySquare) / Math.Cos(_latitudeOfProjectionCentre) / Math.Sqrt(1 - _ellipsoid.EccentricitySquare * Calculator.Sin2(_latitudeOfProjectionCentre));
            Double f  = d + Math.Sqrt(Math.Max(d * d, 1) - 1) * Math.Sign(_latitudeOfProjectionCentre) * Math.Sign(_latitudeOfProjectionCentre);

            _h = f * Math.Pow(tO, _b);
            Double g = (f - 1 / f) / 2;

            _gammaO  = Math.Asin(Math.Sin(_azimuthOfInitialLine) / d);
            _lambdaO = _longitudeOfProjectionCentre - Math.Asin(g * Math.Tan(_gammaO)) / _b;

            if (_azimuthOfInitialLine == Math.PI)
            {
                _uC = _ellipsoid.SemiMajorAxis.Value * (_longitudeOfProjectionCentre - _lambdaO);
            }
            else
            {
                _uC = (Math.Abs(_azimuthOfInitialLine - Constants.PI / 2) <= Calculator.Tolerance) ?
                      _a * (_longitudeOfProjectionCentre - _lambdaO) :
                      (_a / _b) * Math.Atan(Math.Sqrt(Math.Max(d * d, 1) - 1) / Math.Cos(_azimuthOfInitialLine)) * Math.Sign(_latitudeOfProjectionCentre);
            }

            _inverseParams = new Double[]
            {
                _ellipsoid.EccentricitySquare / 2 + 5 * Calculator.Pow(_ellipsoid.Eccentricity, 4) / 24 + Calculator.Pow(_ellipsoid.Eccentricity, 6) / 12 + 13 * Calculator.Pow(_ellipsoid.Eccentricity, 8) / 360,
                7 * Calculator.Pow(_ellipsoid.Eccentricity, 4) / 48 + 29 * Calculator.Pow(_ellipsoid.Eccentricity, 6) / 240 + 811 * Calculator.Pow(_ellipsoid.Eccentricity, 8) / 11520,
                7 * Calculator.Pow(_ellipsoid.Eccentricity, 6) / 120 + 81 * Calculator.Pow(_ellipsoid.Eccentricity, 8) / 1120,
                4279 * Calculator.Pow(_ellipsoid.Eccentricity, 8) / 161280
            };
        }
        /// <summary>
        /// Returns the <see cref="CoordinateProjection" /> instance for the specified method.
        /// </summary>
        /// <param name="method">The method.</param>
        /// <param name="parameters">The parameters.</param>
        /// <param name="ellipsoid">The ellipsoid.</param>
        /// <param name="areaOfUse">The area of use.</param>
        /// <returns>The <see cref="CoordinateProjection" /> instance implementing the method.</returns>
        /// <exception cref="System.ArgumentNullException">
        /// The method is null.
        /// or
        /// The ellipsoid is null.
        /// </exception>
        public static CoordinateProjection FromMethod(CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method", "The method is null.");
            }
            if (ellipsoid == null)
            {
                throw new ArgumentNullException("ellipsoid", "The ellipsoid is null.");
            }

            if (_operations == null)
            {
                LoadOperations();
            }

            if (!_operations.ContainsKey(method))
            {
                return(null);
            }

            // create instance
            return(Activator.CreateInstance(_operations[method], method.Identifier, method.Name, parameters, ellipsoid, areaOfUse) as CoordinateProjection);
        }
        /// <summary>
        /// Loads the operations.
        /// </summary>
        private static void LoadOperations()
        {
            _operations = new Dictionary <CoordinateOperationMethod, Type>();

            // collect all geocentric transformation types within the assembly that matches the specified name
            foreach (Type type in Assembly.GetExecutingAssembly().GetTypes().Where(type => type.IsSubclassOf(typeof(GeocentricTransformation))))
            {
                // query the attribute of the type
                Object attribute = type.GetCustomAttributes(typeof(CoordinateOperationMethodImplementationAttribute), false).FirstOrDefault();
                if (attribute == null)
                {
                    continue;
                }

                // query the method of the transformation
                CoordinateOperationMethod method = CoordinateOperationMethods.FromIdentifier((attribute as CoordinateOperationMethodImplementationAttribute).Identifier).FirstOrDefault();
                if (method == null)
                {
                    continue;
                }

                _operations.Add(method, type);
            }
        }
示例#20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeocentricTransformation" /> class.
 /// </summary>
 /// <param name="identifier">The identifier of the operation.</param>
 /// <param name="name">The name of the operation.</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.
 /// or
 /// The method requires parameters which are not specified.
 /// </exception>
 /// <exception cref="System.ArgumentException">
 /// The parameters do not contain a required parameter value.
 /// or
 /// The parameter is not an angular value as required by the method.
 /// or
 /// The parameter is not a length value as required by the method.
 /// or
 /// The parameter is not a double precision floating-point number as required by the method.
 /// </exception>
 protected GeocentricTransformation(String identifier, String name, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters)
     : base(identifier, name, method, parameters)
 {
 }
示例#21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CoordinateOperation{SourceType, DestinationType}" /> class.
 /// </summary>
 /// <param name="identifier">The identifier of the operation.</param>
 /// <param name="name">The name of the operation.</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.
 /// or
 /// The method requires parameters which are not specified.
 /// </exception>
 /// <exception cref="System.ArgumentException">
 /// The parameters do not contain a required parameter value.
 /// or
 /// The parameter is not an angular value as required by the method.
 /// or
 /// The parameter is not a length value as required by the method.
 /// or
 /// The parameter is not a double precision floating-point number as required by the method.
 /// </exception>
 protected CoordinateConversion(String identifier, String name, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters)
     : base(identifier, name, method, parameters)
 {
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="CoordinateOperation{SourceType, DestinationType}" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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.
        /// or
        /// The method requires parameters which are not specified.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a scalar value as required by the method.
        /// </exception>
        protected CoordinateOperation(String identifier, String name, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters) : base(identifier, name)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method", "The method is null.");
            }

            if (parameters == null && method.Parameters != null && method.Parameters.Count > 0)
            {
                throw new ArgumentNullException("parameters", "The method requires parameters which are not specified.");
            }

            if (parameters != null && method.Parameters != null)
            {
                foreach (CoordinateOperationParameter parameter in method.Parameters)
                {
                    // check for parameter existence
                    if (!parameters.ContainsKey(parameter) || parameters[parameter] == null)
                    {
                        throw new ArgumentException("The parameters do not contain a required parameter value (" + parameter.Name + ").", "parameters");
                    }

                    // check for parameter type
                    switch (parameter.UnitType)
                    {
                    case UnitQuantityType.Angle:
                        if (!(parameters[parameter] is Angle))
                        {
                            throw new ArgumentException("The parameter '" + parameter.Name + "' is not an angular value as required by the method.", "parameters");
                        }
                        break;

                    case UnitQuantityType.Length:
                        if (!(parameters[parameter] is Length))
                        {
                            throw new ArgumentException("The parameter '" + parameter.Name + "' is not a length value as required by the method.", "parameters");
                        }
                        break;

                    case UnitQuantityType.Scale:
                        if (!(parameters[parameter] is IConvertible))
                        {
                            throw new ArgumentException("The parameter '" + parameter.Name + "' is not a scalar value as required by the method.", "parameters");
                        }
                        break;
                    }
                }
            }

            _method = method;

            if (parameters != null)
            {
                _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))
                    {
                        _parameters.Add(parameter, parameters[parameter]);
                    }
                }
            }
        }
示例#23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LambertCylindricalEqualAreaEllipsoidalProjection"/> class.
 /// </summary>
 /// <param name="identifier">The identifier of the operation.</param>
 /// <param name="name">The name of the operation.</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 method requires parameters which are not specified.
 /// or
 /// The ellipsoid is null.
 /// or
 /// The area of use is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">
 /// The parameters do not contain a required parameter value.
 /// or
 /// The parameter is not an angular value as required by the method.
 /// or
 /// The parameter is not a length value as required by the method.
 /// or
 /// The parameter is not a double precision floating-point number as required by the method.
 /// or
 /// The parameter does not have the same measurement unit as the ellipsoid.
 /// </exception>
 protected LambertCylindricalEqualAreaEllipsoidalProjection(String identifier, String name, CoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
     : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
 {
     _falseEasting                  = ((Length)(parameters[CoordinateOperationParameters.FalseEasting])).BaseValue;
     _falseNorthing                 = ((Length)(parameters[CoordinateOperationParameters.FalseNorthing])).BaseValue;
     _longitudeOfNaturalOrigin      = ((Angle)(parameters[CoordinateOperationParameters.LongitudeOfNaturalOrigin])).BaseValue;
     _latitudeOf1stStandardParallel = ((Angle)parameters[CoordinateOperationParameters.LatitudeOf1stStandardParallel]).BaseValue;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LambertConicConformalProjection" /> class.
 /// </summary>
 /// <param name="identifier">The identifier of the operation.</param>
 /// <param name="name">The name of the operation.</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 method is null.
 /// or
 /// The defined operation method requires parameters.
 /// or
 /// The ellipsoid is null.
 /// or
 /// The area of use is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">
 /// The parameters do not contain a required parameter value.
 /// or
 /// The parameter is not an angular value as required by the method.
 /// or
 /// The parameter is not a length value as required by the method.
 /// or
 /// The parameter is not a double precision floating-point number as required by the method.
 /// or
 /// The parameter does not have the same measurement unit as the ellipsoid.
 /// </exception>
 protected LambertConicConformalProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
     : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
 {
 }
示例#25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PolarStereographicAProjection" /> class.
 /// </summary>
 /// <param name="identifier">The identifier of the operation.</param>
 /// <param name="name">The name of the operation.</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 method requires parameters which are not specified.
 /// or
 /// The ellipsoid is null.
 /// or
 /// The area of use is null.
 /// </exception>
 /// <exception cref="System.ArgumentException">
 /// The parameters do not contain a required parameter value.
 /// or
 /// The parameter is not an angular value as required by the method.
 /// or
 /// The parameter is not a length value as required by the method.
 /// or
 /// The parameter is not a double precision floating-point number as required by the method.
 /// or
 /// The parameter does not have the same measurement unit as the ellipsoid.
 /// </exception>
 public PolarStereographicProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
     : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
 {
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="LambertAzimuthalEqualAreaProjection" /> class.
        /// </summary>
        /// <param name="identifier">The identifier of the operation.</param>
        /// <param name="name">The name of the operation.</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 method is null.
        /// or
        /// The defined operation method requires parameters.
        /// or
        /// The ellipsoid is null.
        /// or
        /// The area of use is null.
        /// </exception>
        /// <exception cref="System.ArgumentException">
        /// The parameters do not contain a required parameter value.
        /// or
        /// The parameter is not an angular value as required by the method.
        /// or
        /// The parameter is not a length value as required by the method.
        /// or
        /// The parameter is not a double precision floating-point number as required by the method.
        /// or
        /// The parameter does not have the same measurement unit as the ellipsoid.
        /// </exception>
        protected LambertAzimuthalEqualAreaProjection(String identifier, String name, CoordinateOperationMethod method, Dictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid, AreaOfUse areaOfUse)
            : base(identifier, name, method, parameters, ellipsoid, areaOfUse)
        {
            // EPSG Guidance Note number 7, part 2, page 72

            _latitudeOfNaturalOrigin  = ((Angle)_parameters[CoordinateOperationParameters.LatitudeOfNaturalOrigin]).BaseValue;
            _longitudeOfNaturalOrigin = ((Angle)_parameters[CoordinateOperationParameters.LongitudeOfNaturalOrigin]).BaseValue;
            _falseEasting             = ((Length)_parameters[CoordinateOperationParameters.FalseEasting]).BaseValue;
            _falseNorthing            = ((Length)_parameters[CoordinateOperationParameters.FalseNorthing]).BaseValue;

            _qP    = (1 - _ellipsoid.EccentricitySquare) * ((1 / (1 - _ellipsoid.EccentricitySquare)) - ((1 / 2 * _ellipsoid.Eccentricity) * Math.Log((1 - _ellipsoid.Eccentricity) / (1 + _ellipsoid.Eccentricity), Math.E)));
            _qO    = (1 - _ellipsoid.EccentricitySquare) * ((Math.Sin(_latitudeOfNaturalOrigin) / (1 - _ellipsoid.EccentricitySquare * Calculator.Sin2(_latitudeOfNaturalOrigin))) - ((1 / (2 * _ellipsoid.Eccentricity)) * Math.Log((1 - _ellipsoid.Eccentricity * Math.Sin(_latitudeOfNaturalOrigin)) / (1 + _ellipsoid.Eccentricity * Math.Sin(_latitudeOfNaturalOrigin)), Math.E)));
            _betaO = Math.Asin(_qO / _qP);
            _RQ    = _ellipsoid.SemiMajorAxis.BaseValue * Math.Sqrt(_qP / 2);
            _D     = _ellipsoid.SemiMajorAxis.BaseValue * (Math.Cos(_latitudeOfNaturalOrigin) / Math.Sqrt(1 - _ellipsoid.EccentricitySquare * Calculator.Sin2(_latitudeOfNaturalOrigin))) / (_RQ * Math.Cos(_betaO));

            if (Math.Abs(_latitudeOfNaturalOrigin) - Math.Abs(Angles.NorthPole.BaseValue) <= Calculator.Tolerance)
            {
                _operationAspect = OperationAspect.NorthPolar;
            }
            else if (Math.Abs(_latitudeOfNaturalOrigin) - Math.Abs(Angles.SouthPole.BaseValue) <= Calculator.Tolerance)
            {
                _operationAspect = OperationAspect.SouthPolar;
            }
            else if (_ellipsoid.IsSphere && Math.Abs(_latitudeOfNaturalOrigin) - Math.Abs(Angles.Equator.BaseValue) <= Calculator.Tolerance)
            {
                _operationAspect = OperationAspect.Equatorial;
            }
            else
            {
                _operationAspect = OperationAspect.Oblique;
            }
        }