Author Topic: Question about cached maps  (Read 3906 times)

Offline daled

  • More than Newbie
  • *
  • Posts: 13
    • View Profile
Question about cached maps
« on: January 19, 2011, 02:32:23 »
I've read the "manual" and played around a bit with the offline maps but still do not quite understand how the caching of maps work.  The manaul implies that you need to explicitly request that a region be stored for offline use and give a set of four options for saving the map: 1) Online shared map (SQL) 2) Separate map (SQL) 3)External map (SQL) and 4) Older download map (TAR).

Even when I do not select any of these types explicitly the program appears to cache maps after I view them.  That is, I can view some maps, close the application, disable wireless access, start the application again and successfully browse to those areas that I viewed previously.  It is acting like option #1 is always enabled.  Is this true?  If so, does the cache eventually fill up?  When do maps get purged if not explicitly saved?

If you use option #2 (Separate map), how and when does the data for that map get used vs. the online map data?

By the way, I think Locus is great.  It is fastastic to be able to use multiple different map sources, switch between them and also have the map data availabe for offline use!
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11309
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Question about cached maps
« Reply #1 on: January 19, 2011, 06:03:41 »
You understand well,
  when you browse online maps, tiles are stored into same database as when you download maps with SQL shared mode! So when you turn your data connection off, all already viewed maps will be available in offline mode ...

  cache is on your SDCard in Locus/mapsOnline directory. There is not currently any limitation, so cache will grow until fully fill your card :). Unfortunately, format I'm using do not hold any information about date when tile was added to cache, so I'm not sure how to choose which tiles purge when cache (SD card) is full ...

  when you select separate map, you then on map select screen, click on top "Custum map" tab, and choose your "Separate map". This map will be fully offline and no additional tiles will be added in to it.

I'm glad you like it
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline rkirmeier

  • More than Newbie
  • *
  • Posts: 59
    • View Profile
Re: Question about cached maps
« Reply #2 on: January 19, 2011, 15:58:14 »
So it sounds like using the internal map fetch method does not have the 2GB limit that SQLlite does? I sure prefer making my maps on the computer though. Is there any solution to using larger then 2GB maps AND creating them on the computer?
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11309
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Question about cached maps
« Reply #3 on: January 19, 2011, 16:03:30 »
Sorry, I thought that there is no limit for cached maps but seems that android has generally problem with SQL files bigger then 2GB so I'm still not sure how to do it, but you actually have to check manually if your cached maps aren't too big. I'll have to do some protection but still not sure how ...

Unfortunately no solution for using maps bigger then 2GB is available. (currently)
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline daled

  • More than Newbie
  • *
  • Posts: 13
    • View Profile
Re: Question about cached maps
« Reply #4 on: January 19, 2011, 17:25:59 »
Menion:  Thanks for your explaination.   I understand you to be saying that all maps will be cached until the SD card fills up (and then things will break) or until the cache reaches 2 GB for one map type (and then things will break).  If this is correct, I agree that you need some way to stop the caching before things break.  I do not find any option in the program to clear the cache.  At the least I would think that such an option would be useful or necessary.  lacking such an option, what is the correct way to delete the Online cache?

If all maps are cached, what is the purpose of the first option in the offline maps "Online Shared Maps" settings?  It sounds like you are saying this is always enabled.  Am I misunderstanding something?

If you had some way to indicate in the Online SQL Database which tiles were added automatically by browsing online and which tiles were added explicilty by the user saving them, then if the user asked to have the cache flushed (or if you flushed the cache automatically because the size was too large) you could avoid flushing the tiles that were explicitly cached by the user.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11309
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Question about cached maps
« Reply #5 on: January 19, 2011, 18:03:19 »
just fast answer:

best to clear online maps: just delete correct files in mapsOnline directory!

purpose is: I live in Prague so when I watch map, tiles are cached. I want to go out and I'm not sure if I saw all map tiles in this area at this zoom, so I download whole area with this method which make me sure that all maps are ready for offline and also save me time by downloading tiles that I already saw!

Problem is that I wanted to be compatible with SQL map format of RMaps, but I see, that was a bad idea. SQLite RMaps format contain only x, y, z (tile position) and image data. No informations about tile download time or method of download.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline daled

  • More than Newbie
  • *
  • Posts: 13
    • View Profile
Re: Question about cached maps
« Reply #6 on: January 19, 2011, 20:13:08 »
Thanks for your quick explaination.  I understand.  It is no problem for me to delete the cache files with a file explorer, but for an application that is widely available and useful you probably need to make the cache files take care of themselves and will probably have to enhance the RMaps format to keep a bit more information.
« Last Edit: January 01, 1970, 01:00:00 by Guest »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11309
  • Thanked: 284 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Question about cached maps
« Reply #7 on: January 24, 2011, 10:56:28 »
Hi,
  so since 0.9.6 is in application "file checker" which test cache files. If any of them is too big, app will show dialog with additional information and also with possibility to delete just part of tiles, depend on time. Unfortunately, function that delete rows from database and then compress file ("VACUUM") takes sooooo long (around 10 hours on 2GB file), so I created method that directly copy tiles from old file to new and then old delete and replace with new. This method, on 2GB file, when all tiles are copied, takes 2hours, so better then before.

 It's written in description anyway, I really suggest to delete big file instead of this method. uff ...
« Last Edit: January 01, 1970, 01:00:00 by Guest »
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!