PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label gpx. Show all posts
Showing posts with label gpx. Show all posts

Monday, September 26, 2022

[FIXED] How to reverse engineer a .RIB file?

 September 26, 2022     gps, gpx, java, notepad++, reverse-engineering     No comments   

Issue

In 2019 I bought a Zeal Optics Transcend GPS goggle for a very low price.

These google were produced by Recon Instruments and they were later bought by Intel. The technology was very good an I was able to check my statistics during the day and at home.

enter image description here

Because the googles hit the market on 2012/2013 the technology was a bit old when I bought them but I was still able to upload my data to http://reconinstruments.com/ and I could check online my statistics

enter image description here

Then, some day around 2020 the dashboard wasn't reachable any more, the website was down, and all the Zeal Optics Transcend GPS goggle owner were left alone without any way to upload the data to a dashboard.

But the monitor on the goggle is still working, collecting data, and if I connect the goggle to my computer I can see a DAY08.RIB file that is generated for each day I go to ski.

The files on Notepad++ looks something like this:

enter image description here

Because internet is a fantastic place to be I found someone else in my same situation and on the Intel blog someone suggested to use this GitHub repository which contains a .jar and a .java file to convert the *.RIB to *.GPX.

The repository works very well!

But is missing temperature information.

Is there any way I could reverse engineer a .RIB file because I think that the temperature information are not taken during the conversion. But they must be there. Somewhere.

EDIT: In case you want to download a copy I put 3 of them here

EDIT 2: New data fresh out of the fridge here . As you can see there are 2 files that get generated for each day: DAY14 and EVENT14 but the second one is nearly empty. The goggle started at 14° and said in the fridge 30 minutes. When I took them out of the fridge the temperature on the monitor was 8° and the max reached was 15°.


Solution

Coincidentally I just shared a project on github which I made to do exactly what you're asking, but this is for the Snow2 goggles of Recon Instruments. Here is the repository: https://github.com/stevenhgs/rib-to-gpx-file-converter

In the README you can see how I was able to reverse engineer it.

After taking a quick look at your files I saw that the data of your files do not have the same structure as the files produced by the Snow2 goggles. So the program I shared won't work for your files. However, I was able to see that your track points have a size of 20 and I was able to already see the time, the longitude and latitude in this data.

Is it correct that the activity of the file DAY05.rib took place around 16:48 and at a latitude of 46.xxx and a longitude of 6.xxx?



Answered By - stevenhgs
Answer Checked By - Mildred Charles (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

[FIXED] How to calculate distance from a GPX file?

 September 26, 2022     algorithm, gps, gpx, xml     No comments   

Issue

I have a GPX file with a GPS track. Now I want to calculate the distance I covered with this track.

What's the best way to calculate this?


Solution

The traditional way of calculating the distance between two points (each pair of waypoints in your GPX file) is with the Haversine formula.

I have a SQL Server function that implements the algorithm. This should be easy to translate into other languages:

create function dbo.udf_Haversine(@lat1 float, @long1 float, 
                   @lat2 float, @long2 float) returns float begin
    declare @dlon float, @dlat float, @rlat1 float, 
                 @rlat2 float, @rlong1 float, @rlong2 float, 
                 @a float, @c float, @R float, @d float, @DtoR float
    
    select @DtoR = 0.017453293
    select @R = 3959      -- Earth radius
    
    select 
        @rlat1 = @lat1 * @DtoR,
        @rlong1 = @long1 * @DtoR,
        @rlat2 = @lat2 * @DtoR,
        @rlong2 = @long2 * @DtoR
    
    select 
        @dlon = @rlong1 - @rlong2,
        @dlat = @rlat1 - @rlat2
    
    select @a = power(sin(@dlat/2), 2) + cos(@rlat1) * 
                     cos(@rlat2) * power(sin(@dlon/2), 2)
    select @c = 2 * atn2(sqrt(@a), sqrt(1-@a))
    select @d = @R * @c
    
    return @d 
end

This returns the distance in Miles. For kilometers, replace the earth radius with it's km equivalent.

Here is a more in-depth explanation.

Edit: This function is fast enough and accurate enough for doing radius searches with a ZIP code database. It has been doing a great job on this site for years (but it no longer does, as the link is broken now).



Answered By - cdonner
Answer Checked By - Terry (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing