Example #1
0
        /// <summary>
        /// Parses the GPS data from the specified <paramref name="bmpMetadata" /> and returns the data in an instance of <see cref="GpsLocation" />.
        /// </summary>
        /// <param name="bmpMetadata">An object containing the metadata.</param>
        /// <returns>An instance of <see cref="GpsLocation" />.</returns>
        public static GpsLocation Parse(IWpfMetadata bmpMetadata)
        {
            GpsLocation gps = new GpsLocation();

            gps.Version       = GetVersion(bmpMetadata);
            gps.Latitude      = GetLatitude(bmpMetadata);
            gps.Longitude     = GetLongitude(bmpMetadata);
            gps.Altitude      = GetAltitude(bmpMetadata);
            gps.DestLatitude  = GetDestLatitude(bmpMetadata);
            gps.DestLongitude = GetDestLongitude(bmpMetadata);

            //// Combine date portion of gpsDate or gpsDate2 with time portion of gpsTime2
            //object gpsDate = bmpMetadata.GetQuery("System.GPS.Date"); // System.Runtime.InteropServices.ComTypes.FILETIME
            //object gpsDate2 = bmpMetadata.GetQuery("/app1/ifd/gps/{ushort=29}"); // 2010:08:08

            //DateTime gpsDate3 = Convert((System.Runtime.InteropServices.ComTypes.FILETIME)gpsDate);

            //ulong[] gpsTime2 = bmpMetadata.GetQuery("/app1/ifd/gps/{ushort=7}") as ulong[]; // ulong[3]
            //double hh = SplitLongAndDivide(gpsTime2[0]);
            //double mm = SplitLongAndDivide(gpsTime2[1]);
            //double ss = SplitLongAndDivide(gpsTime2[2]);

            //object satellites = bmpMetadata.GetQuery("System.GPS.Satellites"); //"05"
            //object satellites2 = bmpMetadata.GetQuery("/app1/ifd/gps/{ushort=8}"); //"05"

            //double longitude = ConvertCoordinate(longitudeArray);

            return(gps);
        }
Example #2
0
        /// <summary>
        /// Parses the GPS data from the specified <paramref name="bmpMetadata" /> and returns the data in an instance of <see cref="GpsLocation" />.
        /// </summary>
        /// <param name="bmpMetadata">An object containing the metadata.</param>
        /// <returns>An instance of <see cref="GpsLocation" />.</returns>
        public static GpsLocation Parse(IWpfMetadata bmpMetadata)
        {
            GpsLocation gps = new GpsLocation();

            gps.Version = GetVersion(bmpMetadata);
            gps.Latitude = GetLatitude(bmpMetadata);
            gps.Longitude = GetLongitude(bmpMetadata);
            gps.Altitude = GetAltitude(bmpMetadata);
            gps.DestLatitude = GetDestLatitude(bmpMetadata);
            gps.DestLongitude = GetDestLongitude(bmpMetadata);

            //// Combine date portion of gpsDate or gpsDate2 with time portion of gpsTime2
            //object gpsDate = bmpMetadata.GetQuery("System.GPS.Date"); // System.Runtime.InteropServices.ComTypes.FILETIME
            //object gpsDate2 = bmpMetadata.GetQuery("/app1/ifd/gps/{ushort=29}"); // 2010:08:08

            //DateTime gpsDate3 = Convert((System.Runtime.InteropServices.ComTypes.FILETIME)gpsDate);

            //ulong[] gpsTime2 = bmpMetadata.GetQuery("/app1/ifd/gps/{ushort=7}") as ulong[]; // ulong[3]
            //double hh = SplitLongAndDivide(gpsTime2[0]);
            //double mm = SplitLongAndDivide(gpsTime2[1]);
            //double ss = SplitLongAndDivide(gpsTime2[2]);

            //object satellites = bmpMetadata.GetQuery("System.GPS.Satellites"); //"05"
            //object satellites2 = bmpMetadata.GetQuery("/app1/ifd/gps/{ushort=8}"); //"05"

            //double longitude = ConvertCoordinate(longitudeArray);

            return gps;
        }