topotoolbox.read_from_cache

topotoolbox.read_from_cache#

topotoolbox.read_from_cache(filename: str) GridObject[source]#

Read a GeoTIFF file from the cache directory and return it as a GridObject. The filename should be the name of the GeoTIFF file. Find available files by using ‘get_cache_contents()’.

Parameters:

filename (str) – Name of the file to be read from the cache directory. Requires the whole filename including the extension, like “dem.tif”.

Returns:

The GridObject generated from the cached GeoTIFF file.

Return type:

GridObject

Example

>>> import topotoolbox
>>> import matplotlib.pyplot as plt
>>> dem = topotoolbox.load_dem('bigtujunga')
>>> dem = topotoolbox.read_from_cache('bigtujunga.tif')
>>> _= dem.plot()
>>> plt.show()

(Source code, png, hires.png, pdf)

../_images/topotoolbox-read_from_cache-1.png