-
- All Implemented Interfaces:
-
org.osmdroid.tileprovider.modules.IArchiveFile
public class DatabaseFileArchive implements IArchiveFile
This is the OSMdroid style database provider. It's an extremely simply sqlite database schema. CREATE TABLE tiles (key INTEGER PRIMARY KEY, provider TEXT, tile BLOB) where the key is the X/Y/Z coordinates bitshifted using the following algorithm key = ((z << z) + x << z) + y;
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringTABLEpublic final static StringCOLUMN_PROVIDERpublic final static StringCOLUMN_TILEpublic final static StringCOLUMN_KEY
-
Constructor Summary
Constructors Constructor Description DatabaseFileArchive()
-
Method Summary
Modifier and Type Method Description static DatabaseFileArchivegetDatabaseFileArchive(File pFile)voidsetIgnoreTileSource(boolean pIgnoreTileSource)Set<String>getTileSources()returns a list of tile source names that are available in the archive, if supported. voidinit(File pFile)initialize the file archive, such as performing initial scans, queries, opening a database, etc Array<byte>getImage(ITileSource pTileSource, long pMapTileIndex)InputStreamgetInputStream(ITileSource pTileSource, long pMapTileIndex)Get the input stream for the requested tile and tile source. voidclose()Closes the archive file and releases resources. StringtoString()-
-
Method Detail
-
getDatabaseFileArchive
static DatabaseFileArchive getDatabaseFileArchive(File pFile)
-
setIgnoreTileSource
void setIgnoreTileSource(boolean pIgnoreTileSource)
-
getTileSources
Set<String> getTileSources()
returns a list of tile source names that are available in the archive, if supported. Ifnot supported, return an empty set
-
init
void init(File pFile)
initialize the file archive, such as performing initial scans, queries, opening a database, etc
-
getImage
Array<byte> getImage(ITileSource pTileSource, long pMapTileIndex)
-
getInputStream
InputStream getInputStream(ITileSource pTileSource, long pMapTileIndex)
Get the input stream for the requested tile and tile source.
Also keep in mind that the tile source has an explicit tile size in pixels, and tile source name.
-
close
void close()
Closes the archive file and releases resources.
-
-
-
-