Thursday 7 February 2008

Current Status

Meeting January 16th

Had a meeting with my supervisor on 16th of January, with most of my exams finished besides Digital Signal Processing. This was the only time I could really meet because I was away the following week and wanted to reflex on few ideas during that week.

In the meeting, we discussed an idea that I had on a possible way to visualise and navigate the data collected - next major milestone after extracting locations from GPS data. I'll need to get my hands on a data visualisation book that I was showed, I can't remember the exact title and the author to gather some ideas and letting them settle while I work on the other part of the project.

Gazetteer

Oh, forgot to mention earlier, I met up with Aiden from CDVP on 26th November regarding the gazetteer for querying places names given a GPS coordinate. Aiden gave me access to the Microsoft SQL server so I could use it. Its a slight problem because I haven't figured out how to connect to it from Linux and because its behind a firewall, meaning I only get access to it from the computing labs. I spent a while trying to find a way to covert it to MySQL or Postgresql and the few Visual Basic programs that I have tried did not work.

I also tried to dump the database, which took a while to figure out, but instead of dumping the database on a local drive of the client computer as I have expected it to, it dumped it on a computer which ran the database.

I left it at that, because at that time I got busy with assignments and this was just a nice feature to have rather than a critical feature and didn't spend much time on it.

Progress

Not exactly the most organised section, but I'll try to write down what's going on with the project in more detail.

The project is slightly more definite in my mind. I think the way I'll bridge the access to the data from the user interface is provide some sort of SOAP interface that whatever the UI is in will be able to query the data and present it, wether its in OpenGL, Java 2D(I like this idea since I could just provide an applet to run in a browser) or Ajax.

The last few days I tried to set everything set up on my Mac that I need to develop since I reinstalled it with latest release, Leopard. Darwinports and fink caused me some problems, so did MacFUSE(to be used with sshfs to mount the filesystem of the Nokia tablet so I could just write the code without me needing it to transfer it with scp every time I wanted to make a change!). Eventually I got sshfs to work by installing MacFUSE from DarwinPorts instead of using the installation file Google provides.

I also moved the Nokia tablet system files on a separate 2gb memory card that I have instead of fairly limited space that it comes with. Following these instructions: http://maemo.org/community/wiki/HowTo_EASILY_Boot_From_MMC_card.

I should also take a closer look to maemo(the application development framework that is used on the tablet), because I find the tablet for some reason likes to reboot itself after couple of hours for no particular reason(and this happens when its on a stock 2006 firmware and not just the 2007 Hackers Edition that I'm currently using).

What I could do is develop a little desktop applet(basically, an application which just sits on the desktop and does something) which is run every time the system boots up. It could just show the current GPS location and the bluetooth neighborhood, and when clicked could bring up the history of data collected. Something similar to the iphome applet which just shows the current IP. It could also give an option to which server the data should be transfered. This shouldn't be to hard to do, just re-structuring some the code that I have and hopefully this can be done in Python and not just C as the documentation I have stumbled up is.

Oh, I also have Subversion set up for source version control.

Location Extraction


So I have a lot of individual GPS locations, well, nearly 25k of them! and thats not including the last while when college was finished - I had the data collection off because I was mainly at home at Christmas time. The picture shows the text dump of the GPS data for one of the last few times I was in DCU(and I'm not going to publish GPS coordinates of where I live...). One of the coordinates that I checked is location in the green grass area between the Computing building and Business school as can be seen here. Since GPS is most of the time accurate to 8 - 20 meters, I guess the result is fairly good. I guess I was in one in LG25 or LG26 at the time.

Currently I'm trying to figure out the best way to break down those thousands of GPS coordinates to just:
  • Location Name - automatically given a name from GeoNames.org or DCU' CDVP Gazetteer.
  • Location Coordinates. I was thinking of just a radius from one of the points which increases if the location is bigger. But not exactly very accurate.
    Better solution is to represent this as a polygon.
  • Arrival time - the first point falling into the Location shape.
  • Departure time - the last point falling into the Location shape.

Detecting the shape would be nice, and I think the postgis, spatial database extension could do this.

By basically reshaping the polygon based on the GPS coordinates, i.e adding a coordinate, only changing the shape if there is a coordinate outside the shape(possibly taking an average of 3-5 coordinates to try to level out the GPS noise). Not exactly sure would this work or not or exactly how.

I haven't done much testing on this. It took me ages to get Postgres to work on my laptop.
requiring to install it from Darwinports but it would not start up due to not having enough shared memory resource memory. Then tried postgres from fink, but hit another problem and can't remember now what it was.
Eventually I got postgres from Darwinports working but to get it to start up was a problem, eventually I found the system limits I need to increase in the Postgres installation from Fink.

Now to install install postgis, I hit this bug, basically not able to compile it. There is a link in one of the bug comments which links to a way to fix it. I got it to compile. But I hit another problem, I tried to create a table with geometry column(following How do I insert a GIS object into the database?):
CREATE TABLE gtest ( ID int4, NAME varchar(20) );
SELECT AddGeometryColumn('', 'gtest','geom',-1,'LINESTRING',2);

But when trying to insert data with:
INSERT INTO gtest (ID, NAME, GEOM)
VALUES (
1,
'First Geometry',
GeomFromText('LINESTRING(2 3,4 5,6 5,7 8)', -1)
);
Postgres crashes with the following unhelpful message:

LOG: server process (PID 54160) was terminated by signal 10
LOG: terminating any other active server processes
FATAL: the database system is in recovery mode
LOG: all server processes terminated; reinitializing
LOG: database system was interrupted at 2008-02-07 17:08:01 GMT
LOG: checkpoint record is at 0/E253A8
LOG: redo record is at 0/E253A8; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 0/731; next OID: 24576
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system was not properly shut down; automatic recovery in progress
LOG: record with zero length at 0/E253F0
LOG: redo is not required
LOG: database system is ready

Basically, not much progress on postgres/postgis now. I'll try to set it up on my
Ubuntu desktop at home over the weekend and see what I can do with it.

Oh, and writing blog posts is very time consuming in getting all the relevant information together!

No comments: