Champlain.FileCache

g Champlain.FileCache Champlain.FileCache Champlain.MapSource Champlain.MapSource Champlain.TileCache Champlain.TileCache Champlain.MapSource->Champlain.TileCache Champlain.TileCache->Champlain.FileCache GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Champlain.MapSource GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

None

Methods

Inherited:

Champlain.TileCache (3), Champlain.MapSource (20), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new_full (size_limit, cache_dir, renderer)

get_cache_dir ()

get_size_limit ()

purge ()

purge_on_idle ()

set_size_limit (size_limit)

Virtual Methods

Inherited:

Champlain.TileCache (3), Champlain.MapSource (9), GObject.Object (7)

Properties

Inherited:

Champlain.MapSource (2)

Name

Type

Flags

Short Description

cache-dir

str

r/w/co

The directory of the cache

size-limit

int

r/w/c

The cache’s size limit (Mb)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Champlain.TileCache

r

Class Details

class Champlain.FileCache(**kwargs)
Bases:

Champlain.TileCache

Abstract:

No

Structure:

Champlain.FileCacheClass

The Champlain.FileCache structure contains only private data and should be accessed using the provided API

New in version 0.6.

classmethod new_full(size_limit, cache_dir, renderer)
Parameters:
  • size_limit (int) – maximum size of the cache in bytes

  • cache_dir (str or None) – the directory where the cache is created. When cache_dir == None, a cache in ~/.cache/champlain is used.

  • renderer (Champlain.Renderer) – the Champlain.Renderer used for tiles rendering

Returns:

a constructed Champlain.FileCache

Return type:

Champlain.FileCache

Constructor of Champlain.FileCache.

New in version 0.8.

get_cache_dir()
Returns:

the directory

Return type:

str

Gets the directory where the cache database is stored.

New in version 0.6.

get_size_limit()
Returns:

size limit

Return type:

int

Gets the cache size limit in bytes.

New in version 0.4.

purge()

Purge the cache from the less popular tiles until cache’s size limit is reached.

New in version 0.4.

purge_on_idle()

Purge the cache from the less popular tiles until cache’s size limit is reached. This is a non blocking call as the purge will happen when the application is idle

New in version 0.4.

set_size_limit(size_limit)
Parameters:

size_limit (int) – the cache limit in bytes

Sets the cache size limit in bytes.

New in version 0.4.

Property Details

Champlain.FileCache.props.cache_dir
Name:

cache-dir

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The directory where the tile database is stored.

New in version 0.6.

Champlain.FileCache.props.size_limit
Name:

size-limit

Type:

int

Default Value:

100000000

Flags:

READABLE, WRITABLE, CONSTRUCT

The cache size limit in bytes.

Note: this new value will not be applied until you call Champlain.FileCache.purge()

New in version 0.4.