Android Question B4A (solved) osmdroid - offline maps sqlitedb

pompierecattivo

Member
Licensed User
Hello,
i've tryed to post my question on another thread, but it is long time no one post on it, so i've decided to open a new one.
i'm testing for b4a apps using offline sqlitedb maps. As others, i've obtained an empty screen using the example 11 provided at the fist page of main thread. I'm not sure what i have to indicate on SetTileSource (my map file's named "sardroidmap.sqlitedb"). Of couse i've placed it directly on osmdroid folder. I'm quite sure about my map file because i could open it correctly in a Locus GIS (beta) app. But of course i dont know if same "sqlitedb" extension could be used for different kind of data inside... I'm using 3.0.8 ver of osmdroid.
Any help appreciate, thank you.
Sorry for my bad english.
 

pompierecattivo

Member
Licensed User
Hi tigrot, thanks for answer.
osmdroid solution probably are the best for my project. But i need to know how to use offline maps, what kind of conversion i have to made. I didn't found how to let osmdroid work despite a very explanative post by his author. My maps are quite little, so in GIS aplications i could have just one raster file. If i right understand, when i make the sqlitedb file it contains both the tiles suddivision of raster image and the correct geographics parameters of the map. But i'm not able to use it with osmdroid...
 
Upvote 0

js486dog

Active Member
Licensed User
Hi tigrot, thanks for answer.
osmdroid solution probably are the best for my project. But i need to know how to use offline maps, what kind of conversion i have to made. I didn't found how to let osmdroid work despite a very explanative post by his author. My maps are quite little, so in GIS aplications i could have just one raster file. If i right understand, when i make the sqlitedb file it contains both the tiles suddivision of raster image and the correct geographics parameters of the map. But i'm not able to use it with osmdroid...
Hi my friend I am only begginer but some comments:

I think you can not use sqlitedb (x/y/z) as Locus uses. You have to use sqlite (no x/y/z) as osmdroid uses.
Try MOBAC and create osmdroid sqlite map to see the structure. Be carreful he provider must be Mapnik and your sqlite maps must be in the osmdroid folder on the external memory.
MOBAC has the bug and the provider is not writen as Mapnik. You have to change the name of the provider by the SQLite Studio (free). Or use MAPC2MAPC - there is support for osmdroid sglite maps in a new version.

B4A code is somethink like this:

MapView1.Initialize("MapView1")
' ensure that the map displays the Mapnik tiles
MapView1.SetTileSource("Mapnik")
' disable the data connection
MapView1.SetDataConnectionEnabled(False)

Look at the attached pictures.

Regards
Jan
 

Attachments

  • osmdroid sqlite structure.jpg
    osmdroid sqlite structure.jpg
    78.4 KB · Views: 388
  • MOBAC osmdroid sqlite.jpg
    MOBAC osmdroid sqlite.jpg
    181.8 KB · Views: 529
Upvote 0

pompierecattivo

Member
Licensed User
Hi Jan,
reading you, i don't think you are "only beginner".... :)

Thank you very much for your very clear answer. I will try all your suggest because i'm very interested to better know how osmdroid library work. As true i've found a workaround, also because my best is not use MOBAC (better explain, i need to convert an offline map generated by others gis. Beyond online maps, MOBAC can do it adding different xml, but also here i've found some difficult).
My workaround is simply use mbtiles format. I think is not much different by sqlitedb, but using mbtiles format osmdroid work correctly. And of course i could generate it from alot of gis.
About your explain, me too i've tried to analize content of sqlite db and i've found someting "wrong". But not able myself to say "what's wrong". o your reply is very intresting and i think could help others like me are "really" beginners.
So thank you again. Instead your explanation, i will mark this post as "solved", if moderators are in accord.
Always sorry for my english....

Maurizio.
 
Upvote 0
Top