How to delete a zoom factor in a sqlitedb map?

Started by tramp20, June 07, 2013, 15:07:52

0 Members and 1 Guest are viewing this topic.

tramp20

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/.

My SQL knowledge is very very old.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

Menion

#1
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
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

tramp20

#2
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.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

Menion

#3
- 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?
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

tramp20

#4
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?
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

tramp20

#5
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.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

tramp20

#6
Hi menion,
if you have time can you answer my question too?
viewtopic.php?f=10&t=3144&p=21341#p21340
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

gynta

#7
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

Menion

#8
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
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

tramp20

#9
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.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

tramp20

#10
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
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •