Encoding of points in dbtracks.sqll

Started by rivol, February 10, 2012, 20:35:59

0 Members and 1 Guest are viewing this topic.

rivol

Hi

I have some tracks recorded by Locus and I'm thinking of playing around with the data - writing an app to analyze it, visualize it or do something else interesting.
I want to read the tracks directly from the sqlite DB instead of exporting and then importing the data, because that would be too slow and cumbersome.

The problem is, I need to access the points of each track. Looking at the dbtracks.sqll database, I can see that the points of each track are encoded in some kind of binary format. So would it be possible to find out the encoding of that format?
  •  

Menion

#1
Hi,
  I use own format for storing such informations that don't need any searching or similar operations. You will do some operations over them in Java? I can tell you current format of "points" column. This is not hard. It's just an array of location (android specific) objects

loc = new Location(dis.readUTF());
loc.setLatitude(dis.readDouble());
loc.setLongitude(dis.readDouble());
loc.setAltitude(dis.readDouble());
loc.setBearing(dis.readFloat());
loc.setSpeed(dis.readFloat());
loc.setAccuracy(dis.readFloat());
loc.setTime(dis.readLong());

Anyway column "waypoints" is really really complex and in this case I rather suggest to export/import. Ask if you're interested in any specific information, just ask ...
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

rivol

#2
Awesome, thanks! That's exactly what I needed :-)

It should be quite easy to write a Python function to extract the data I need ;-)

About the 'waypoints' column, it seems to be empty in my tracks. Is it used for routing info? Anyway, I don't need that, the points themselves are enough.
  •  

Menion

#3
perfect. Yes it's for routing info or just generally on points where are some special informations. Also should be interesting for you column "breaks" where are indexes of points on which track was paused or when some tracks were merged etc. And one last info ... number of points in "points" column is not known. When I read this data, I just read till some data are available :). Just for your info to save some time with searching for some number of points

ah and also this should be helpful for you. http://code.google.com/p/android-locus- ... Utils.java ... scroll to bottom. There is storing and loading of locations in current Locus API. It's same in database (I hope :) )
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

rivol

#4
The number of points actually seems to be known, in the 'num_points' column ;-) At least for the few tracks I checked it seemed to be correct.

The Java code doesn't completely correspond to the points format, e.g. it has the timestamp before the lon/lat.

Anyway, thanks again for the swift replies, I'll be back if I run into more problems/questions :-)
  •