View Single Post
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#827
Originally Posted by beermad View Post
I think your proposed versioning makes sense. As long as we add any new columns after the existing columns so that if anybody's already using the schema and doing "select(*)" we won't break their code.

Your idea of a hash-like index using separators seems a good idea. My only other thought was to force each of the x,y,z elements to a fixed length (perhaps by adding 1000000 to each, depending on what the biggest number each one could possibly be). But your method makes it more compact.

Then for version 2, your lookup table could be:
Code:
CREATE TABLE tiles (z INTEGER, x INTEGER, y INTEGER, store_filename STRING, extension varchar(10), unix_epoch_timestamp INTEGER, store_tilenumber INTEGER, lookup STRING, PRIMARY KEY(lookup));
CREATE TABLE version (v integer);
CREATE INDEX oldindex on tiles (z,x,y);
For version 3, drop the z,x,y and extension columns as well as the oldindex index.

Version 2 of the tile store could be:
Code:
CREATE TABLE tiles (z INTEGER, x INTEGER, y INTEGER, tile BLOB, extension VARCHAR(10), unix_epoch_timestamp INTEGER, id INTEGER AUTO INCREMENT, PRIMARY KEY(id));
CREATE TABLE version (v integer);
CREATE INDEX oldindex on tiles (z,x,y);
For version 3, drop the oldindex index. You could keep the x,y,z columns in this table for regenerating the lookup table as you mentioned. You could shrink the lookup table a bit more for version 3 by also dropping the epoch_timestamp from it. That would introduce a slight overhead when checking for updated tiles as it would need to be retrieved from the store rather than the lookup. I'm not sure which way would give the best balance of benefits.

So you'd insert the tile in the store first, then retrieve the value of the id column to populate the store_tilenumber column in the lookup table.
Thanks for the new schemas & hints ! I'm not really that much into database design, so this is really helpful. Now I just need to find some more free time to actually implement this.

Originally Posted by don_falcone View Post
May i strongly suggest not using MyDocs and using dirs located directly under $HOME instead? MyDocs is exportable / mountable, so for example if you have connected your N900 via USB to a laptop maybe for copying some files over, you would not be able to use modRana (or any other SW that does this) at the same time and would have to choose between using the SW or copying files.
Vitally important files are already in $HOME (configs and settings storage) or /opt/modrana (turn message substitution rules).
Other files just need to be in MyDocs:
  • map data - $HOME only has 2 GB & sharing with other apps
  • tracklogs - to be accessible through mass storage
  • POI - sharing with Mappero
ModRana should actually work even when the MyDocs partition is not mounted - tiles would download & display just fine, just would not be stored, tracklogs would be unavailable and it would not be possible to store new POI. Well, I have not actually tested this yet but it should work - or can be fixed to work.

@more layers
What is currently precluding adding more map layers (I know about quite a few nice OSM based ones for example) is actually the layer selection method. The current toggle-based one is already barely usable. I'll do something about this and then start adding new layers.

Originally Posted by x-lette View Post
Another question (I guess this is already answered but I didn't find): Is there an easy way to download all needed tiles for an area externally and afterwards just throw them into correct folder on N900? downloading a bunch of some 20k tiles at once is quite hard. My N900 gets quite hot when using 3G-connection that intense.
You can install modRana or for example GMapCatcher on your PC and then transfer the corresponding tile folders to the N900 (to /home/user/MyDocs/.maps/).
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)

Last edited by MartinK; 2011-08-08 at 13:04.
 

The Following 2 Users Say Thank You to MartinK For This Useful Post: