eumap.mapper.SpaceTimeOverlay

class SpaceTimeOverlay(points, col_date, fn_layers=[], max_workers=2, verbose=False)[source]

Bases: object

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

Parameters
  • points – The path for vector file or geopandas.GeoDataFrame with the points.

  • col_date (str) – Date column to retrieve the year information.

  • fn_layers (List[str]) – A list with the raster file paths. The file path placeholders {year}, {year_minus_1}, {year_plus_1} are replaced considering the year information of each point.

  • max_workers (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.

Examples

>>> from eumap.mapper import SpaceTimeOverlay
>>>
>>> fn_layers = [ 'raster_{year_minus_1}1202..{year}0320.tif' ] # raster_20101202..20110320.tif, ...
>>> spt_overlay = SpaceTimeOverlay('./my_points.gpkg', 'survey_date' fn_layers)
>>> result = spt_overlay.run()
>>>
>>> print(result.shape)

Methods

run

Execute the spacetime overlay.

run()[source]

Execute the spacetime overlay. It removes the year part from the column names. For example, the raster raster_20101202..20110320.tif results in the column name raster_1202..0320.

Returns

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

Return type

geopandas.GeoDataFrame