slv.basemap.cached_tiler#
- slv.basemap.cached_tiler(tiles, **kwargs)[source]#
A cartopy tiler that caches its tiles on disk, safe to build in several processes at the same moment.
The tiler is
tiles(cache=True, **kwargs). cartopy checks that the tiler’s cache folder is missing and then makes it with a plainmkdir. When another process makes the folder between the check and themkdir(parallel tests, or jobs on one node that each draw their first map), the tiler raisesFileExistsError. The folder exists by then, so a second attempt finds it and makes nothing.- Parameters:
tiles (type) – The tiler class, e.g.
cartopy.io.img_tiles.GoogleTiles.**kwargs – Passed to
tiles, e.g.style="satellite".
- Returns:
The tiler, an instance of
tiles.- Return type:
cartopy.io.img_tiles.GoogleWTS
Examples
>>> from cartopy.io.img_tiles import GoogleTiles >>> tiler = cached_tiler(GoogleTiles, style="satellite")