1

I am working with osmdroid map viewer in offline mode. I have downloaded tiles with Mobile Atlas creator with osmdroid zip format and everything is ok. I want to know that is it possible to have more than one zip file? I just want 2 or 3 different locations that are far away from each other.

any help?

Ali Behzadian Nejad
  • 8,804
  • 8
  • 56
  • 106

3 Answers3

2

Yes, you can have more than one zip file in the folder. I have 3 files corresponding to different areas on my device. They all give me a map display when offline.

NickT
  • 23,844
  • 11
  • 78
  • 121
  • I want to load one of these zip files at a time. loading all of them at the same time will cause OutOfMemoryException – Ali Behzadian Nejad Apr 23 '12 at 09:28
  • For information, my 3 files of the different areas are sized 18, 36 and 64MB. I don't get any OOM exceptions. I think Osmdroid checks all zip files in the folder in turn to see if that particular tile is there before going online for it. How big are your zip files? – NickT Apr 23 '12 at 10:40
  • Two of them are about 50MB. Some others are less than 10MB. – Ali Behzadian Nejad Apr 23 '12 at 10:49
  • Perhaps I'm just lucky that my phone has a lot of memory then. I have a huge area of London in the 64MB file down to zoom level 16 (which lets me read the street names). This works all the time without incurring me any data usage costs. Perhaps if you chopped up your 50Mb files into smaller ones it might work on your phone. – NickT Apr 23 '12 at 10:55
  • Is there a way to extract zip files in different directories? I think that opening zip files is a time and resource consuming task. – Ali Behzadian Nejad Apr 23 '12 at 14:20
  • Not with the jar file as it stands. You could build your own version of Osmdroid though, see http://stackoverflow.com/questions/9568079/osmdroid-change-local-map-folder – NickT Apr 23 '12 at 14:26
1

I was thinking that there is always one zip file for one layer - like mapinik, osmarender etc.

But... I looked into the code and it seems that you might be able to do so. Take a look inside of zip file and if there is structure like: mapinik/zoomLevel/x/y - you should be able to add another file with same structure which should work.

I see that the code is looking inside all archive files for tile path. Im just not sure what "all archive files" meens and I have no time to investigate or test this :)

Hope that helped a little bit.

Mark
  • 5,466
  • 3
  • 23
  • 24
0

OutOfMemory exception is because heapsize is full. Most/all of Android phones have small heapsize (from 16 to 48mb). There should be also a workaround - to export data into SQLite instead of ZIP, atlas creator can also do that. I havent seen OSMdroid code for a while but Im pretty sure he can also read this kind of stuff and you will not have a OutOfMemory problem then. One thing about SQLite is 2gb limit but it's still not bad.

Mark
  • 5,466
  • 3
  • 23
  • 24