tisdag 10 mars 2009

Obscure file formats begone!

I am very pleased. It seems that Apple are realising what the Open Source world realised a long time ago: inventing your own file format for everything just wastes a lot of time and will only keep the applications on the computer to be separate islands with very little cooperation. An, for the user, this is always a very bad thing.

Instead, it seems that more and more Apple is realising that there are good alternative already developed for storing structured data. The famous .plist are just XML files, which you may edit in any text editor to your hart's content. Why complicate things? Adress book, and I think all the things does more heavy data mangling (like the new iPhoto) are just packaged SQLite3 files. You can easilly test this yourself:

Just cd to the iPhoto library:

> cd Pictures/iPhoto\ Library
> echo ".schema"|sqlite3 face_blob.db
CREATE TABLE detected_face_blob (image_key int, face_index int, recogBuffer blob, histogram64Buffer blob);
CREATE TABLE face_name_blob (face_key integer, attrs blob);
CREATE INDEX detected_face_index_a1 ON detected_face_blob(image_key, face_index);
CREATE INDEX face_name_index_a1 ON face_name_blob(face_key);

> echo ".schema"|sqlite3 iPhotoMain.db
CREATE TABLE AlbumsPhotosJoin (sqAlbum INT, sqPhotoInfo INT, photosOrder INT);
CREATE TABLE GpsTracksEventsJoin (sqGpsTrack INT, sqEvent INT);
CREATE TABLE KeywordsPhotosJoin (sqKeyword INT, sqPhotoInfo INT);
CREATE TABLE MasterSchema (primaryKey INTEGER PRIMARY KEY AUTOINCREMENT, version INT, theSchema BLOB);
...
[OUTPUT TRUNCATED]


To me, it is not so strange that interaction between Mac apps runs smoothly.. it is all down to just asking questions in standardized / openly documented languages. Standards are good.. I like standards.

söndag 8 mars 2009

Aerotools InFlight for Sony Ericsson P1i

After having experimented some more, I find the InFlight program to be quite good for what I would use it for. Watching my track through the streets of my town is quite amusing :-).
Though, there is an ussue when it comes to the user interface and the P1i: the keys given in the manual for the application are not the same for this phone.

So, the manual says:

1. Moving Map - Vector Mode:
2. Moving Map - Bitmap Mode:
3. GPS Logger
4. Time Logger
5. GPS Information
6. Keyboard Test
7. Glide Path Monitor
8. Density Altitude Calculator and QNH
0.About Screen

Also, ther is a main menu (accessed from the right menu button) and a context menu (left menu button). On the P1i, this is not true, instead you have:

q. Moving Map - Vector Mode:
w. Moving Map - Bitmap Mode:
e. GPS Logger
r. Time Logger
t. GPS Information
y. Keyboard Test
u. Glide Path Monitor
i. Density Altitude Calculator and QNH
+ (=ALT+0).About Screen

The main menu you get from the 'x' key, and the context bound menu you get using the 'a' key.
Anyway, great little app! -)

A complete geo-tagging solution

I have been experimenting. I already have a DSLR (Canon 350D) with a lot of extras (like a battery grip and three lenses) so I really do not see myself changing cameras for the time beeing. Ok, I know that this is the entry-level model of Canon SLRs, but I am really happy with it (except for the poor screen) so I will not upgrade for a while. But then, I really would like to have geographical information in my images. In the absence of an almost-free-trade-in campaign for Canon cameras :-) I just have to solve this in some other way.

I was looking at the Sony GPSCS1KA GPS for a while, and almost bought one, but then I found a number of posts saying that this unit may not work on Mac yet, and that the previous generation of the device took for ever to get compatibla with Mac OS X. Also, it is a bit expensive, so I thought I would rather not risk it.

But, I have a P1i. Ans, Sony Ericsson did once try to get into the GPS phone marked by a product they call(ed) a "GPS enabler", the HGE-100. So, presto.. why do I need a GPS logger? The unit was actually cheaper on Amazon than a walkman stereo headset (which I needed to replace anyway) and all I needed to find was some software that would log position and output it in a usable format. I thought that this would be easy, but I was very much mistaken.

I have tried many programs for GPS naviation and logging. All but one seemed to have a problem doing what I wanted it to do. Either the only supported Bluetooth GPS devices, a serial device, or they really needed a map which you had to download or buy, or you could not get the log out from the internal file used by the program. Arrrgh! I almost lost my interest in the entire project..

But, I think I have found a solution. Thanks to some flying ethusiasts, there is a program called InFlight (http://aerotools.hoshis.org/). It does a lot of things, but one of these things is to log GPS coordinates, at user definable intervals. Then, you upload the log file to their server through the phone application (ou have ot create an account first) and download the log file in a 2 D kml file. This file you can either view in Google Earth directy, or convert into GPX/NMEA format using the free tool HoudahGPS), for later geo-tagging of the pictures taken on the trip using HoudahGeo. Complicated, but it works. Of course, the phone and camera should really be set to the same time, but maybe this is a good idea anyway. :-)

So what about pictures already taken? Ok, you can geo-tag them using HoudahGeo + Google earth, but this is a bit awkward. Too many windows and things that keeps getting in the way. I instead prefer Geotagger. Very easy to use: just 1) navigate to the spot in Google Earth and 2) mark the images (in iPhoto or in an import folder) and drag them to the Geotagger icon on the dock (you have to place it there of course). This causes the coordinates to be inserted in the EXIF info of the files, and you do not have to do anything else really for the files to be tagged. Very easy.

Well, there is a further complication if you are using iPhoto and want to geo-tag pictures you have already imported. The problem is that iPhoto reads the EXIF information at import, and then store these in the database. I wise decision, but this means that if you geo-tag a picture already imported, iPhoto will never pay any attention to the new information. A further comlicaiton is that this information is not updated even if you in iPhoto '08 try to rebuild the database. Even further, there does not seem to be any tool available for forcing a re-import of metadata, including GPS coordinates. This issue had been extensivelly discussed on the Apple forum.

There is a solution though. in iPhoto '09 seems to update metadata when you choose to rebuild the database. So, just keep ALT-CMD pressed when starting iPhoto 09, and choose rebuild database (or, since the iPhoto 09 metadata is now kept in a sqlite database :-) you can just update it using a script, like this one ). I have not tested this myself, so I can only go by other people are reporting. For iPhoto 08 though, this will not work. Instead, you will have to do the "hoding ALT-CMD pressed when starting iPhoto"-routine, but also choose to update the thumbnails. This apparently causes iPhoto to also update the metadata cache, and with it the GPS coordinates. This will take a while though... I guess this is another reason why you would like to upgrade to iPhoto 09 :-).

(Of course, these instructions are provided with any guarrantee that they will work for you. I will not be held responsible if something breaks for you because of the use of these instructions.)

måndag 2 mars 2009

Yes, I have resisted the urge to buy an iPhone...

I am sorry. I was (and I guess still am) tempted to buy an iPhone each time I see one. It is seems quite slick, fast and wonderful in most respects, but still I have not bought one. Why? First, it is quite expensive. Though I like having good and sophisticated phones, I think there are limits to what you acctually gain by having a very cool phone. In the end it might just be a very cool phone :-)

Second, I like texting. I acctually use more than 90% of my credit for texting, and I text with both thumbs simultaneously, so this is important. I have tried writing texts on the iPhone in the store, and it sucks big time when it comes to writing SMS:es (IMHO). I never hit the right button on the screen, and forget about writing with both hands. Not possible, or at least not for someone with big thumbs like me :-)

Third, I am "pot commited" to my current brand, i.e. with Sony Ericsson P1i. I have already bought most of the things I need in SonyEricsson compatible hardware, so I am really recuctant to switcha nd buy it all over again. Also, the P1i syncs quite well with iSync apps, so what would change when purchasing an iPhone? Not much, I think.

So, after a long period of wanting to buy the iPhone, and later a Palm Pre, I have decided to keep my P1i, and instead make the most of it. As the first step in this aim, I just ordered an HGE-100 GPS reciever for it. I was looking for a GPS logger for geo-tagging, and I somehow got the idea that "Hey, I already am carrying around a small computer, with the ability to rung navigation software, so why not make the most of it?". After all, what I really want is just to have something that silently keeps track of where I am while taking pictures. And, since I usually bring my phone and my stereo headset just broke down, it all seemed like such a good idea.
Just need some software.

TreckBuddy seems very promising. Exports to a lot of formats usable by HoudahGeo, and seems to be meant to be used for recordning tracks rather than navigation. Will try it when it arrives.. I have to admit that I am a bit excited. :-) I guess I could use some of the money that I would spend on an iPhone on iLife '09 instead. Seems appropriate :-)