Main Menu

auto-switch map

Started by webmoly, September 29, 2011, 08:22:33

0 Members and 1 Guest are viewing this topic.

webmoly

when I'm using offline map and I move from one city to another one, I need to change the offline map manually or when I zoom out in a city it canno't change the map to another one which has the needed zoom.

eg. I have the offline map for a city for zoom 14 to 17 and I have the whole country map from zoom 0 to 13

I'm in a city and I zoom out to 14. I cannot zoom out to 13 but if locus could recognize the map it would be able to change the map so it could show zoom 13...

I wish I could merge the maps into one but couldn't succeed
  •  

stebu

#1
Hi!

If your maps are originally made by Locus (xxxx.sqlitedb), soon there will be a program available, that converts these maps into .GEMF maps. The program will let you to merge several .sqlitedb maps into one .GEMF map.
There is no "autoswitch", but the whole map is one file that combines all .sqlitedb maps.

The definition of .GEMF maps can be found at //http://www.cgtk.co.uk/gemf

My application can be found at <link removed, see below>. It is I'written for Windows (Win7), but when I get the bugs sorted out, I will release the source code.

The bugs: I'm using a TCC(Tiny C) compiler and sometimes a map tile fails to be written into the .GEMF file (fwrite()). If you change the order of the input .sqlitedb files, it might help. Also omitting some zoom levels may help. Probably an uninitialised variable or an overflow, but I haven't found it yet :?: . Any input is appreciated!

Also, Menion should make a compatible release for .GEMF map that uses the "allow empty" property. And fix the zoom level presentation in private maps-

EDIT: See new thread in sqlite to GEMF map conversion tool
The bugs have been ironed out, it works on Win32 (XP and Win7 32-bit compatibility mode)
  •  

webmoly

#2
Hi

I created my maps using MOBAC in sqlitedb (rmaps)
After searching a lot, I found a small application named "BigPlanetSQLiteMerger 0.1" that could merge 2 maps into one Sqlitedb and it worked fine.

I managed to merge all my maps into one single map.. maps had different zoom level and it works fine.

I hope GEMF gives more option to users..
can't wait to use it..
  •  

Khaytsus

#3
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.
  •  

Menion

#4
just one hint, to merge sqlite maps, just create subfolder in locus/maps directory and put maps you want merge into this folder ;)
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

webmoly

#5
Quote from: "menion"just one hint, to merge sqlite maps, just create subfolder in locus/maps directory and put maps you want merge into this folder ;)

Is that it?
name of sub-folder?
and then what?

the procedure..
  •  

Khaytsus

#6
Quote from: "menion"just one hint, to merge sqlite maps, just create subfolder in locus/maps directory and put maps you want merge into this folder ;)
I haven't tried it, but I'm guessing what he means is that the subdir will show as the Map, then it'll use any within there...  

But I doubt it's going to merge two sets of the same map into one map, just to clarify, since that's what my post was about.  :)
  •  

stebu

#7
Well, I have not been able to merge .sqlitedb maps? For example, I have two maps from Amsterdam with different zoom levels;
I cannot switch between them with zoom +/- buttons, the only way is to select another map from map tool.

I have improved my sqlite-->gemf tool, that allows to combine several sqlite maps into one gemf map.

There are still 2 problems:
1) my program cannot handle combined maps that are larger than 2 Gb (2 000 000 000), but the support will be available soon.
2) the program does not run consistently on my Win7, UNLESS  
         I right click on it and on the "Compatibility" leaf tick
         the "Run this program in compatibility mode for" (Windows XP(sp3)

If anybody has any input for problem 2), I would appreciate that a lot! (TCC info is:
         "tcc version 0.9.25 - Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard")

Anyhow, the latest version (alpha 003) is available at sql2g
  •