osmdroid sqlite tile source - android

I want to add a SQLite tile provider to OSMDroid just like RMaps. I went through OSMDroid source code and its tile providers and I found that they are designed to get tiles from File, Archive file and internet.
I am using osmdroid-android 3.0.5.

I don't belive this is possible with the current Osmdroid library. If you want to do it you will have to create your own TileProvider to fit into the framework which should be possible.
I expect that using an archive file for the actual map tiles and a seperate database for your meta data is by far the simplest solution. Putting large amounts of data like the tiles into the database is not recomended.

Have a look at this page. I think this is what you are looking for :o)
I recently implemented a sqlite storage for the tiles of the osmdroid lib, and the only thing missing is the ability to create it with mobac. So I wrote this patch to provide the new output option. Please have a look and commit it if you like it. Let me know if you think I should change something.

Related

How to add style into .mbtiles file

I downloaded a payed .mbtiles file from Open Street Map and managed to create nice maps using openmaptiles-server over Kitematic.
However, I would like to use this .mbtiles file as offline repository of tiles in an Android based application I'm writing.
My plans are to have the mbtiles file stored on an SD card, and let osmdroid MapView read it from there.
However, the file doesn't contain (apparently..) the styling information on its own.
My question is how do I add a styling info such as "OSM Bright" or "Klokantech Basic" to my project so the map on my application looks like a proper map
Many thanks
It's not possible to render bitmap tiles on a device just from information contained in mbtiles data file.
What actually is a mbtiles file?
A mbtiles file is just an SQLite database which contains a very little amount of metadata and rendered bitmap images - tiles Those are the same bitmap files you would be serving online from your openmaptiles-server.
Size of mbtiles file versus size of tiles
MBtiles file size should be almost the same as the overall size of all generated files on your mbtiles server (it's the same number of tiles in each zoom level and the same number of pixels in each tile). If you see a significant difference, it may mean that your mbtiles file doesn't contain the same zoom range (e.g. it doesn't actually contain those most detailed zoom levels) or it contains a smaller area. Some difference may be also caused by a compression algorithm of contained bitmaps and here the actual styling of tiles may play some role (some bitmaps may be easier to compress a resulting PNG may be smaller.
It may be also possible, that the mbtiles file actually contains another image format (jpeg).
If you want to explore what is actually contained in the downloaded mbtiles file, try this tool.
Solution
I don't' think there is a solution when you need to use bitmap tiles. You need to either generate them on a server and download them via network, or you need to prerender them and pack into a mbtile file and download that to a device somehow.
One possible solution would be to use vector maps. It's actually possible to generate vector tiles from Openstreetmap data. Such tiles are than rendered on a device and can actually be styled on the device too.
Unfortunately, Osmdroid library does not support vector tiles at the time of writing (AFAIK). You would have to choose a different map rendering library.

Android OpenStreetMap tracker available offline

I'm new at osmdroid and I'm trying to build simple GPS tracking application that must work offline. So first of all I know that osmdroid works with .osm But how to download osm file directly to my android device and more importantly how later I need to use it. I dont understand .osm file is simply just xml with lots of coordinates and other data. So how that .osm file can be transform to a graphical map? I know that is necessary to parse .osm file to get data, but where to download actual graphical map?
osmdroid does not currently present .osm data, mainly due to performance reasons. osmdroid does render raster images that someone can capture into a zip or database and then transfer to device. The problem really is space. It's a big planet and getting raster images can be huge! You'd have to prepare geographic regions into a database then host them somewhere and have your app download them on demand.
osmdroid as a wiki on offline maps here:
https://github.com/osmdroid/osmdroid/wiki/Offline-Map-Tiles
An alternative approach is something like Mapsforge, which can preconvert .osm data into their own binary format, also chunked up by geographic region. Same rules apply, however the file/download sizes are much smaller. Support for osmdroid using Mapsforge is in beta at the moment, however mapsforge can run on it's own and has it's own demo apps and whatnot.
To transform the .osm file into a graphical map, you need something like renderd and a slew of other tools, all on open street maps wiki. Again, you need a boat ton of storage for the planet to convert it into raster images. Then you'd still have to package them somehow and get them on device.
Or you can just use online maps.

How to use an mbtiles database with Android TileProvider?

What is the best way to use an mbtiles database with google's TileProvider?
I've been told that tiles as files are difficult to manage so i'm trying to use the mbtiles directly.
Take a look here:
https://github.com/cocoahero/android-gmaps-addons/blob/master/src/com/cocoahero/android/gmaps/addons/mapbox/MapBoxOfflineTileProvider.java
That class will do it for you.
I hope you can use it.

How to access Offline Maps in Android

I was given a task where i need to build an offline map i have shape file and a kml file..
I found something about kml where i need to parse the data and overlay the data on the maps.but it should be done from scratch.If there any tutorial Please do help me for kml.
or
IS there any easy way to store the maps offline and use it in android. i see lot of things like tpk,.map etc
please do help i am struck with this from abt a week and dint find any clue how to do it..
tpk is basically doing the map with tile packages concept, whereas the other option involves using sqlite format compact cache. for more details, you can consult arcgis library at
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#/Welcome_to_the_ArcGIS_Server_10_Help/009300000004000000/
and also this is for OSMdroid library
http://www.haakseth.com/?p=30. hope it will help you

What solutions do we have to read and display Autocad DWG files on Android?

I would like to display rich maps contained in Autocad .dwg files in my Android app. I'd like to know if there is an existing java library to do so?
If not, is it doable to translate a dwg file to a model and draw that model shape by shape on the screen?
I can't use Google maps instead of these files. The whole point of the app is to display a map with a lot of data and all that data is contained in my autocad files library.
Besides, is there an alternative format to DWG that I could use to do exactly this? (UPDATE: would SVG do the trick?)
What I ended up doing is to convert all my files in KML. I've selected this format because it might be the most used format on Android to do GIS.
To make a custom map, I'm drawing overlays on a mapview using these hints. It's basically the most interesting solution. I don't need to pay attention to geolocation stuff, the cursor and the scale are manage by Google API itself.
If you're going to convert I'd probably suggest DXF. I haven't used it, but YCad is a java DXF library. There are also a number of DXF to SVG converters available but it's probably best to avoid two conversions.

Categories

Resources