Beispiel #1
0
        /// <summary>
        /// Gets the key's value.
        /// </summary>
        /// <returns></returns>
        public virtual double AsDouble()
        {
            string valueKey = BuildTokenForDouble();

            AssertTypeSafe(valueKey, NativeTypeForKey(valueKey), GribValueType.Double);

            double val;

            GribApiProxy.GribGetDouble(_handle, valueKey, out val);

            return(val);
        }
        /// <summary>
        /// Gets the key's value.
        /// </summary>
        /// <param name="inDegrees">if set to <c>true</c>, GribApi.NET will return the value [in degrees] when possible.</param>
        /// <returns></returns>
        public virtual double AsDouble(bool inDegrees = true)
        {
            string valueKey = BuildTokenForDouble(inDegrees);

            AssertTypeSafe(valueKey, NativeTypeForKey(valueKey), GribValueType.Double);

            if (!IsDefined)
            {
                return(Double.NaN);
            }

            double val;

            GribApiProxy.GribGetDouble(_handle, valueKey, out val);

            return(val);
        }