View Single Post
gnuite's Avatar
Posts: 1,245 | Thanked: 421 times | Joined on Dec 2005
#138
I know you all have been waiting patiently, so I thought I'd give you a bit of status regarding Maemo Mapper v2.0. This post is basically about letting you know what's working and what's left to be done. I still don't have a release date in mind.

Of course, maps are now stored in a database. I tried using sqlite, and the code to use sqlite is actually still there, but it's #ifdef'ed out right now because of speed and overhead concerns. I might allow the option to use sqlite in the future, but I don't see much point to it. The one advantage that it gave was the ability to avoid storing the same maps (those pesky 103-or-106-byte single-color maps), but even with that advantage, the overhead was still significantly higher than the solution that I chose (duplicate maps are both rare and small; ignoring them saved only maximum 5% disk space).

The chosen database solution is GDBM, which is a simple hash-map database with some decent in-memory caching. The one downside to GDBM is that it doesn't automatically pack the database when deleting a map (that space is instead re-used later when other maps are added), so deleting maps won't immediately reduce the size of the database. The packing has to be done manually, and I've been thinking about whether to perform that step automatically when Maemo Mapper closes, or to make it a button that the user presses to manually initiate the packing.

Anyway, the database solution works really well, and although it's a bit slower than using the file system directly (no concurrency in database access; same problem with sqlite), the file system overhead is significantly lower. I can't wait to get this enhancement to you guys, but I'm still testing it and working on my other v2.0 additions, like ...

I have completely changed the GPS data retrieval and map retrieval to ditch curl and asynchronous Gnome-VFS in favor of multi-threaded, synchronous Gnome-VFS calls. This doesn't mean anything to most of you, but the consequence is that Maemo Mapper can retrieve both map data and GPS data from just about anything that Gnome-VFS supports (HTTP, FTP, file on disk, GPSD). It also might fix the crashing problem when a bluetooth GPS device goes out of range. The map downloading works all right, although it may be a little slower. I'm still working out some bugs in the GPS data retrieval, particularly with out-of-range detection and subsequent retrying-without-failing.

Map rotation works, but it's not the fastest thing in the world. There are actually no GTK library calls to rotate an image by an arbitrary angle, so I had to do all the math by hand (matrices, yay). The rotated OpenStreetMap PNGs are actually surprisingly readable, but you will have a harder time reading them, especially if they are upside down. I did manage to keep memory usage low, but the consequence is that any change in the viewpoint takes up to 0.25 seconds or so to redraw (not as fast as v1.x). And yes, auto-rotate is implemented so that--when Auto-Center is enabled--Maemo Mapper will automatically rotate the viewpoint to follow your heading. You can also rotate the viewpoint manually with the directional buttons. You can still choose to map the directional buttons to panning, but you may not need to, because...

I've added drag-to-pan functionality, so when you tap-and-drag the stylus on the map, the map moves with your stylus. It actually looks pretty slick. The old "single-tap to center on a location" mechanism is still in place. I also added "tap on a waypoint to see the description."

And then there's the POI Search stuff that I mentioned in this thread. Check out the thread for details.