skmap.overlay.SpaceOverlay#

class SpaceOverlay(points, catalog, raster_tiles=None, tile_id_col='tile_id', n_threads=4, verbose=True)[source]#

Bases: object

Overlay a set of points over multiple raster files. The retrieved pixel values are organized in columns according to the filenames.

Parameters:
  • points (GeoDataFrame | str | DataFrame) – The path for vector file or geopandas.GeoDataFrame with the points.

  • catalog (DataCatalog) – scikit-map data catalog.

  • n_threads (int) – Number of CPU cores to be used in parallel. By default all cores are used.

  • verbose (bool) – Use True to print the overlay progress.

Methods

read_data

read data in parallel across blocks, normally called by self.run

run

Execute the space overlay.

read_data(gdal_opts, max_ram_mb)[source]#

read data in parallel across blocks, normally called by self.run

Parameters:
  • gdal_opts (dict[str, str]) – additional options to pass to GDAL

  • max_ram_mb (int) – max RAM to use in MB

Returns:

return array ?with overlay applied?

Return type:

ndarray

run(max_ram_mb, out_file_name, gdal_opts={'CPL_VSIL_CURL_ALLOWED_EXTENSIONS': '.tif', 'GDAL_HTTP_VERSION': '1.0'})[source]#

Execute the space overlay.

Parameters:
  • gdal_opts (Dict[str, str]) – Options for GDAL in a dictionary.

  • max_ram_mb (int) – Maximum RAM that can be used for the overlay expressed in MB.

Returns:

Data frame with the original columns plus the overlay result (one new column per raster).

Return type:

DataFrame