-
- All Implemented Interfaces:
-
org.osmdroid.tileprovider.modules.IFilesystemCache
public class SqliteArchiveTileWriter implements IFilesystemCache
An implementation of IFilesystemCache based on the original TileWriter. It writes tiles to a sqlite database. It does NOT support expiration and provides more of a MOBAC like functionality (non-expiring file archives). Uses the same schema as MOBAC osm sqlite and the DatabaseFileArchive
https://github.com/osmdroid/osmdroid/issues/348
-
-
Constructor Summary
Constructors Constructor Description SqliteArchiveTileWriter(String outputFile)
-
Method Summary
Modifier and Type Method Description booleansaveFile(ITileSource pTileSourceInfo, long pMapTileIndex, InputStream pStream, Long pExpirationTime)Save an InputStream as the specified tile in the file system cache for the specified tilesource. booleanexists(ITileSource pTileSource, long pMapTileIndex)return true if the map file for download already exists voidonDetach()Used when the map engine is shutdown, use it to perform any clean up activities and to terminateany background threads booleanremove(ITileSource tileSource, long pMapTileIndex)Removes a tile from the cache, see issuehttps://github. LonggetExpirationTimestamp(ITileSource pTileSource, long pMapTileIndex)Gets the cache expiration timestamp of a tile CursorgetTileCursor(Array<String> pPrimaryKeyParameters)DrawableloadTile(ITileSource pTileSource, long pMapTileIndex)-
-
Constructor Detail
-
SqliteArchiveTileWriter
SqliteArchiveTileWriter(String outputFile)
-
-
Method Detail
-
saveFile
boolean saveFile(ITileSource pTileSourceInfo, long pMapTileIndex, InputStream pStream, Long pExpirationTime)
Save an InputStream as the specified tile in the file system cache for the specified tilesource.
- Parameters:
pTileSourceInfo- a tile sourcepMapTileIndex- a tilepStream- an InputStream
-
exists
boolean exists(ITileSource pTileSource, long pMapTileIndex)
return true if the map file for download already exists
-
onDetach
void onDetach()
Used when the map engine is shutdown, use it to perform any clean up activities and to terminateany background threads
-
remove
boolean remove(ITileSource tileSource, long pMapTileIndex)
Removes a tile from the cache, see issuehttps://github.com/osmdroid/osmdroid/issues/426
-
getExpirationTimestamp
Long getExpirationTimestamp(ITileSource pTileSource, long pMapTileIndex)
Gets the cache expiration timestamp of a tile
-
getTileCursor
Cursor getTileCursor(Array<String> pPrimaryKeyParameters)
-
loadTile
Drawable loadTile(ITileSource pTileSource, long pMapTileIndex)
-
-
-
-