I have thought about the topic of merging as well, since I primarily download maps on my tablet, but I may also download them, at least in certain places, on my phone. I'd ideally like to upload these two to my computer, merge, and download again. Right now it goes Tablet->PC and Phone<-PC (in both cases the device initiates over rsync).
I was thinking I could simply dump and combine or something in sqlite programatically, but haven't experimented yet. Most solutions on the internet about combining or merging multiple sqlite tables are to examine them in a virtual table which is not written to disk, only that you're examining the set of data from multiple tables in a single table, where I'd like to merge them into a single table and write that to disk. I just need to experiment some, but I think it might be as easy as dumping both databases into a new database.
sqlite3 database-from-phone.sqlitedb .dump | sqlite combined.sqlitedb
sqlite3 database-from-tablet.sqlitedb .dump | sqlite combined.sqlitedb
Quick test of this and it does work.. I went into offline mode, cleared cache on a map type I don't use, went online, grabbed some tiles, went back into offline mode, exited Locus. Did this in two different locations on Phone and Tablet, merged the two databases per the example above, downloaded it back to the phone. Both locations I viewed are viewable. Just to double check I'm not seeing any immediate "read only" weirdness (I have a thread on this, can't update a database I copied from one device to another) I went into Online mode, explored around a bit, back into offline mode, exited. Ran Locus again and the new tiles were still in the database. Yay! So looks like this is viable.
My largest database is 440M and it takes about 10s to dump, so no issue on how long it'll take to dump, merge.. I'm thinking 30-40s for the largest map to merge is reasonable, I have 1.2G total, I figure maybe 90s tops to merge all of them.
I was thinking I could simply dump and combine or something in sqlite programatically, but haven't experimented yet. Most solutions on the internet about combining or merging multiple sqlite tables are to examine them in a virtual table which is not written to disk, only that you're examining the set of data from multiple tables in a single table, where I'd like to merge them into a single table and write that to disk. I just need to experiment some, but I think it might be as easy as dumping both databases into a new database.
sqlite3 database-from-phone.sqlitedb .dump | sqlite combined.sqlitedb
sqlite3 database-from-tablet.sqlitedb .dump | sqlite combined.sqlitedb
Quick test of this and it does work.. I went into offline mode, cleared cache on a map type I don't use, went online, grabbed some tiles, went back into offline mode, exited Locus. Did this in two different locations on Phone and Tablet, merged the two databases per the example above, downloaded it back to the phone. Both locations I viewed are viewable. Just to double check I'm not seeing any immediate "read only" weirdness (I have a thread on this, can't update a database I copied from one device to another) I went into Online mode, explored around a bit, back into offline mode, exited. Ran Locus again and the new tiles were still in the database. Yay! So looks like this is viable.
My largest database is 440M and it takes about 10s to dump, so no issue on how long it'll take to dump, merge.. I'm thinking 30-40s for the largest map to merge is reasonable, I have 1.2G total, I figure maybe 90s tops to merge all of them.