Locus Map - forum

Support => Troubles & Questions => Topic started by: tramp20 on June 07, 2013, 15:07:52

Title: How to delete a zoom factor in a sqlitedb map?
Post by: tramp20 on June 07, 2013, 15:07:52
Hi,
is it somehow possible to delete a complete zoom factor from a personal map .sqlitedb?
I don't want to download this map again because it has now already 2 GB :-(

I have the sqlite manager addon for Firefox from https://code.google.com/p/sqlite-manager/ (https://code.google.com/p/sqlite-manager/).

My SQL knowledge is very very old.
Title: Re: How to delete a zoom factor in a sqlitedb map?
Post by: Menion on June 07, 2013, 15:51:45
let's try it

1. backup your map!
2. open file in add-on
3. you now need to know which zoom level you want to delete. Zoom levels are computed as 17 - z if I remember correctly :). So whole world is 17 - 0 = "17", almost street level described in locus as for example 16 is here  17 - 16 = 1!
4. in tab execute SQL write something like SELECT * FROM tiles WHERE z == 'X' where X is your computed zoom. By this you may check if it really found something. Unfortunately this add-on do not allow to display image in "image" column (btw. suggest to use SQLite Expert Personal 3 - free program where you may also check image in last column)
5. if all is fine, to delete tiles in this level just run DELETE FROM tiles WHERE z == 'X'
6. also suggest to delete column zooms (click with right button and set to 'null') in table "info". Locus will then re-initialize your map to get correct available zoom levels

hope this will work and helps. Let me know if there will be any problem
Title: Re: How to delete a zoom factor in a sqlitedb map?
Post by: tramp20 on June 07, 2013, 16:28:12
Quote from: "menion"(btw. suggest to use SQLite Expert Personal 3 - free program where you may also check image in last column)

Thank you.
I installed your suggestion, what should I see under images?
I see the same signs in the the whole db (attached screen shot).

And if I want to remove zoom 17 then "X" should be 0?

I will try this when the weather will become bad :-)
A 2 GB file is really big.
Title: Re: How to delete a zoom factor in a sqlitedb map?
Post by: Menion on June 07, 2013, 16:37:52
- hmm I'm just checking last column and seems to have a problems with JPEG files. You may at least tap with right button > Hex editor > save and store data as image and check if it's correct zoom

- yes 17 should be 0

- and 2GB, if you have A4.0+, then this limit should be extended to 4 GB or you already have problems in Locus with this huge map?
Title: Re: How to delete a zoom factor in a sqlitedb map?
Post by: tramp20 on June 07, 2013, 16:45:49
Quote from: "menion"6. also suggest to delete column zooms (click with right button and set to 'null') in table "info". Locus will then re-initialize your map to get correct available zoom levels


Where should I do this?
In SQLite Expert I don't find this.
Please add a screen shot.


In the meantime deleting zoom 17 succeeded and the database is smaller now.
Can I now  in Locus continue downloading other parts of my selected region and will these be imported to the existing map?
Title: Re: How to delete a zoom factor in a sqlitedb map?
Post by: tramp20 on June 07, 2013, 16:51:20
Quote from: "menion"- hmm I'm just checking last column and seems to have a problems with JPEG files. You may at least tap with right button > Hex editor > save and store data as image and check if it's correct zoom


- and 2GB, if you have A4.0+, then this limit should be extended to 4 GB or you already have problems in Locus with this huge map?

If I save this as .png then I see a tile.

I have 4.04 and didn't know that the limit can be at 4 GB.
No, I have no problems with this map, I only feared to get some :-)

Thank you for your help till now.
Title: Re: How to delete a zoom factor in a sqlitedb map?
Post by: tramp20 on June 07, 2013, 19:29:16
Hi menion,
if you have time can you answer my question too?
viewtopic.php?f=10&t=3144&p=21341#p21340 (http://forum.locusmap.eu/viewtopic.php?f=10&t=3144&p=21341#p21340)
Title: Re: How to delete a zoom factor in a sqlitedb map?
Post by: gynta on June 07, 2013, 20:18:21
Quote from: "tramp20"is it somehow possible to delete a complete zoom factor from a personal map .sqlitedb?
Sure - and it's easy...  ;)

eg(!)

#copy your my.sqlitedb to D:

#Save this text as "SQLite_source.xml" to MobileAtlasCreatormapsources
<?xml version="1.0" encoding="UTF-8"?>
<localTileSQLite>
<name>SQLite atlas</name>
<sourceFile>D:my.sqlitedb</sourceFile>
<atlasType>RMaps</atlasType>
<backgroundColor>#000000</backgroundColor>
</localTileSQLite>

#Start MobileAtlasCreator

#Select  "SQLite atlas"

#Create a new atlas with your new zooms

edit
The idea ist not new.
Thanks brotbuexe
for -> http://docs.locusmap.eu/doku.php/commun ... g_sqlitedb (http://docs.locusmap.eu/doku.php/community:splitting_sqlitedb)
Title: Re: How to delete a zoom factor in a sqlitedb map?
Post by: Menion on June 08, 2013, 07:52:27
gynta solutions should also work, but when you know what to do, deleting rows directly in database is for sure faster. And zooms are in table "info", so switch in left panel to "info" table and there you column with list of zooms
Title: Re: How to delete a zoom factor in a sqlitedb map?
Post by: tramp20 on June 08, 2013, 13:54:13
Quote from: "menion"gynta solutions should also work, but when you know what to do, deleting rows directly in database is for sure faster. And zooms are in table "info", so switch in left panel to "info" table and there you column with list of zooms

Thank you.
I did it in your way and now I found the zooms too.
Title: Re: AW: How to delete a zoom factor in a sqlitedb map?
Post by: tramp20 on June 08, 2013, 17:48:15
Quote from: "gynta"
Quote from: "tramp20"is it somehow possible to delete a complete zoom factor from a personal map .sqlitedb?
Sure - and it's easy...  ;)
eg(!)
...
Sorry I forgot to thank you too.

Gesendet von meinem LG-P970