gplately.PresentDayRasterManager

class gplately.PresentDayRasterManager(data_dir='present-day-rasters', raster_manifest=None)[source]

Bases: object

Manage the present-day rasters.

__init__(data_dir='present-day-rasters', raster_manifest=None)[source]

Constructor. Create a PresentDayRasterManager instance.

Parameters:
  • raster_manifest – The URL to a present_day_rasters.json metadata file. Normally you don’t need to provide this parameter unless you would like to setup your own present-day raster server.

  • data_dir – The path to a folder to save the present-day raster files.

Methods

__init__([data_dir, raster_manifest])

Constructor.

get_raster(_name[, width, height, bbox, ...])

Download a raster file by name, save the raster file in self.data_dir and return the local path to the raster file.

is_wms(_name[, check_raster_avail_flag])

Return True if the raster is served by Web Map Service, otherwise False

list_present_day_rasters()

Return a list of available present-day rasters.

set_data_dir(data_dir)

Set a new data folder to save the present-day rasters.

Attributes

rasters

The metadata of rasters.

get_raster(_name: str, width=1800, height=800, bbox=[-180, -80, 180, 80], large_file_hint=True)[source]

Download a raster file by name, save the raster file in self.data_dir and return the local path to the raster file.

Call list_present_day_rasters() to see a list of available present-day raster names.

Parameters:

_name (str) – The raster name of interest.

Returns:

The local path to the downloaded raster file.

Return type:

str

is_wms(_name: str, check_raster_avail_flag=True)[source]

Return True if the raster is served by Web Map Service, otherwise False

Parameters:
  • _name (str) – The raster name of interest.

  • check_raster_avail_flag (bool) – If the flag is True, validate the raster name against the raster configuration.

list_present_day_rasters()[source]

Return a list of available present-day rasters.

property rasters: Dict

The metadata of rasters.

set_data_dir(data_dir)[source]

Set a new data folder to save the present-day rasters.