예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GeographicToTopocentricConversion" /> class.
        /// </summary>
        /// <param name="parameters">The parameters of the operation.</param>
        /// <param name="ellipsoid">The ellipsoid.</param>
        /// <exception cref="System.ArgumentNullException">
        /// The ellipsoid 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.
        /// </exception>
        public GeographicToTopocentricConversion(IDictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid)
            : base(CoordinateOperationMethods.GeographicToTopocentricConversion.Identifier, CoordinateOperationMethods.GeographicToTopocentricConversion.Name, CoordinateOperationMethods.GeographicToTopocentricConversion, parameters)
        {
            if (ellipsoid == null)
            {
                throw new ArgumentNullException("ellipsoid", "The ellipsoid is null.");
            }

            _ellipsoid = ellipsoid;
            _latitudeOfTopocentricOrigin          = ((Angle)parameters[CoordinateOperationParameters.LatitudeOfTopocentricOrigin]).BaseValue;
            _longitudeOfTopocentricOrigin         = ((Angle)parameters[CoordinateOperationParameters.LongitudeOfTopocentricOrigin]).BaseValue;
            _ellipsoidalHeightOfTopocentricOrigin = ((Length)parameters[CoordinateOperationParameters.EllipsoidalHeightOfTopocentricOrigin]).BaseValue;

            _originRadiousOfPrimeVerticalCurvature = _ellipsoid.RadiusOfPrimeVerticalCurvature(_latitudeOfTopocentricOrigin);

            _conversion = new GeographicToGeocentricConversion(_ellipsoid);

            _originGeocentricCoordinate = _conversion.Forward(new GeoCoordinate(_latitudeOfTopocentricOrigin, _longitudeOfTopocentricOrigin, _ellipsoidalHeightOfTopocentricOrigin));

            _sinLamda0 = Math.Sin(_longitudeOfTopocentricOrigin);
            _cosLamda0 = Math.Cos(_longitudeOfTopocentricOrigin);

            _sinFi0 = Math.Sin(_latitudeOfTopocentricOrigin);
            _cosFi0 = Math.Cos(_latitudeOfTopocentricOrigin);
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CompoundGeographic3DTransformation" /> class.
        /// </summary>
        /// <param name="identifier">The identifier.</param>
        /// <param name="name">The name.</param>
        /// <param name="method">The method.</param>
        /// <param name="parameters">The parameters.</param>
        /// <param name="source">The source geographic coordinate reference system.</param>
        /// <param name="target">The target geographic coordinate reference system.</param>
        /// <param name="areaOfUse">The area of use.</param>
        /// <exception cref="System.ArgumentException">The specified method does not contain 3 submethods.</exception>
        public CompoundGeographic3DTransformation(String identifier, String name, CompoundCoordinateOperationMethod method, IDictionary <CoordinateOperationParameter, Object> parameters, GeographicCoordinateReferenceSystem source, GeographicCoordinateReferenceSystem target, AreaOfUse areaOfUse)
            : base(identifier, name, method, null, source, target, areaOfUse)
        {
            if (method.Methods.Count != 3)
            {
                throw new ArgumentException("The specified method does not contain 3 submethods.", "method");
            }

            _sourceConversion = new GeographicToGeocentricConversion((source.Datum as GeodeticDatum).Ellipsoid);
            _transformation   = GeocentricTransformationFactory.FromMethod(method.Methods[1], parameters);
            _targetConversion = new GeographicToGeocentricConversion((target.Datum as GeodeticDatum).Ellipsoid);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GeocentricToTopocentricConversion" /> class.
        /// </summary>
        /// <param name="parameters">The parameters of the operation.</param>
        /// <param name="ellipsoid">The ellipsoid.</param>
        /// <exception cref="System.ArgumentNullException">
        /// The ellipsoid 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 a length value as required by the method.
        /// </exception>
        public GeocentricToTopocentricConversion(IDictionary <CoordinateOperationParameter, Object> parameters, Ellipsoid ellipsoid)
            : base(CoordinateOperationMethods.GeocentricToTopocentricConversion.Identifier, CoordinateOperationMethods.GeocentricToTopocentricConversion.Name, CoordinateOperationMethods.GeocentricToTopocentricConversion, parameters)
        {
            if (ellipsoid == null)
            {
                throw new ArgumentNullException("ellipsoid", "The ellipsoid is null.");
            }

            _geocentricXOfTopocentricOrigin = ((Length)parameters[CoordinateOperationParameters.GeocenticXOfTopocentricOrigin]).BaseValue;
            _geocentricYOfTopocentricOrigin = ((Length)parameters[CoordinateOperationParameters.GeocenticYOfTopocentricOrigin]).BaseValue;
            _geocentricZOfTopocentricOrigin = ((Length)parameters[CoordinateOperationParameters.GeocenticZOfTopocentricOrigin]).BaseValue;

            GeographicToGeocentricConversion _conversion = new GeographicToGeocentricConversion(ellipsoid);
            GeoCoordinate geographicCoordinate           = _conversion.Reverse(new Coordinate(_geocentricXOfTopocentricOrigin, _geocentricYOfTopocentricOrigin, _geocentricZOfTopocentricOrigin));

            _sinLamda0 = Math.Sin(geographicCoordinate.Longitude.BaseValue);
            _cosLamda0 = Math.Cos(geographicCoordinate.Longitude.BaseValue);

            _sinFi0 = Math.Sin(geographicCoordinate.Latitude.BaseValue);
            _cosFi0 = Math.Cos(geographicCoordinate.Latitude.BaseValue);
        }