Skip to content

RasterImageCache

Namespace: ThinkGeo.Core

Holds decoded rasters so that sources share one copy instead of each keeping its own.

public static class RasterImageCache

Inheritance object → RasterImageCache

Remarks:

A map asks the same raster for a dozen or more tiles per redraw, and again on every pan, so decoding once and cropping from memory is far cheaper than decoding per tile. Left to itself that grows without limit - every open layer holding its own image - which is what this bounds. Two layers reading the same file share a single decode.

Eviction is least-recently-used and skips anything currently being read, so the total can briefly exceed RasterImageCache.MaximumBytes when everything held is in use.

Properties

MaximumBytes

Gets or sets the total decoded bytes to hold before evicting. Defaults to 1 GB in a 64-bit process and 192 MB in a 32-bit one.

public static long MaximumBytes { get; set; }

Property Value

long

Remarks:

Lowering this evicts straight away, as far as entries not currently being read allow.

CurrentBytes

Gets the decoded bytes currently held.

public static long CurrentBytes { get; }

Property Value

long

Count

Gets the number of decoded images currently held.

public static int Count { get; }

Property Value

int

Methods

Clear()

Releases everything not currently being read.

public static void Clear()

Returns

void

A(string)

internal static string A(string )

Parameters

`` string

Returns

string

A(long)

internal static bool A(long )

Parameters

`` long

Returns

bool

A(string, Func<GeoImage>)

internal static bC A(string , Func<GeoImage> )

Parameters

`` string

`` Func<GeoImage>

Returns

bC

a(string)

internal static void a(string )

Parameters

`` string

Returns

void

A(A)

internal static void A(A )

Parameters

`A`

Returns

void