eumap.mapper.SpaceOverlay¶
- class SpaceOverlay(points, fn_layers=[], dir_layers=[], regex_layers='*.tif', max_workers=2, verbose=True)[source]¶
Bases:
objectOverlay a set of points over multiple raster files. The retrieved pixel values are organized in columns according to the filenames.
- Parameters
points – The path for vector file or
geopandas.GeoDataFramewith the points.fn_layers (
List[str]) – A list with the raster file paths. If it’s not provided thedir_layersandregex_layersare used to retrieve the raster files.dir_layers (
List[str]) – A list of folders where the raster files are located. The raster are selected according to the pattern specified inregex_layers.regex_layers – Pattern to select the raster files in
dir_layers. By default all GeoTIFF files are selected.max_workers (
int) – Number of CPU cores to be used in parallel. By default all cores are used.verbose (
bool) – UseTrueto print the overlay progress.
Examples
>>> from eumap.mapper import SpaceOverlay >>> >>> spc_overlay = SpaceOverlay('./my_points.gpkg', ['./raster_dir_1', './raster_dir_2']) >>> result = spc_overlay.run() >>> >>> print(result.shape)
Methods
Execute the space overlay.
- run(dict_newnames={})[source]¶
Execute the space overlay.
- Parameters
dict_newnames (
set) – A dictionary used to update the column names after the overlay. Thekeyis the new name and thevalueis the raster file name (without extension).- Returns
Data frame with the original columns plus the overlay result (one new column per raster).
- Return type
geopandas.GeoDataFrame