Package 

Class SqliteArchiveTileWriter

  • 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

    • Method Summary

      Modifier and Type Method Description
      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.
      boolean exists(ITileSource pTileSource, long pMapTileIndex) return true if the map file for download already exists
      void onDetach() Used when the map engine is shutdown, use it to perform any clean up activities and to terminateany background threads
      boolean remove(ITileSource tileSource, long pMapTileIndex) Removes a tile from the cache, see issuehttps://github.
      Long getExpirationTimestamp(ITileSource pTileSource, long pMapTileIndex) Gets the cache expiration timestamp of a tile
      Cursor getTileCursor(Array<String> pPrimaryKeyParameters)
      Drawable loadTile(ITileSource pTileSource, long pMapTileIndex)
      • Methods inherited from class org.osmdroid.tileprovider.modules.IFilesystemCache

        exists, remove, saveFile
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 source
        pMapTileIndex - a tile
        pStream - 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