src package

Submodules

src.main module

class src.main.MainProcessor(tiles)

Bases: object

create_new_split_tile_tasks()

Creates new tasks for splitting tiles. Only creates as many split tile tasks as cores that have been specified in the config.

Returns

None

start_processing_loop()

Initiates as many threads as specified in the configuration :return: None

src.main.get_next_task(task_queue, in_progress_queue, completed_dtm, completed_dsm, lock)

Retrieves a new task from the queue if there is one, otherwise idles until task is available or killed :return: None

src.raster module

class src.raster.Raster(raster_name, filepath, stage)

Bases: object

clip(tile: src.tile.Tile)

Clips this raster according to the size of original geometry of the tile provided :param tile: Tile element corresponding with this raster :return: None

close()
get_downsampled_save_location()
get_raster_name()
get_stage()
homogenize_patchwork()

Uses a complete water polygon for all water bodies to fix the patched water bodies from the subtiles. Each subtile will interpolate its own value for the water, creating distinct lines, this function will take the mean of these different patches and apply that value to an overlapping polygon which replaces all the patched cells.

Returns

None

open()

src.task module

class src.task.Task(task: str, arguments: list)

Bases: object

execute()

Function called by a thread when it is ready to run its next task, ensures functions and arguments are routed correctly.

Returns

Result from executed task, differs depending on task being executed

get_task_type()

src.tile module

class src.tile.Tile(tile_name: str, geometry: shapely.geometry.polygon.Polygon, tile_type: str = 'main', unbuffered_geometry: shapely.geometry.polygon.Polygon = None, parent_tile: Optional[src.tile.Tile] = None)

Bases: object

close()
get_bottom()

Returns tile to the bottom of this tile :return: List with tile filepath, or empty list if no adjacent exists

get_bottom_left()

Gets all known filepaths for tiles in the left bottom. So: left, left-bottom, and bottom as these are all needed to get overlap for this corner.

Returns

List of all tile filepaths, or empty list if no adjacent exists

get_bottom_right()

Gets all known filepaths for tiles in the right bottom. So: right, right-bottom, and bottom as these are all needed to get overlap for this corner.

Returns

List of all tile filepaths, or empty list if no adjacent exists

get_geometry()
get_left()

Returns tile to the left of this tile :return: List with tile filepath, or empty list if no adjacent exists

get_parent_tile()
get_right()

Returns tile to the right of this tile :return: List with tile filepath, or empty list if no adjacent exists

get_save_path(stage: str, subtile_id: str, extension: str)

Returns full path for any processing stage based on the id provided

Save to: base path tile_name subtiles subtile_id

Parameters
  • stage – str representing which step you are at (subtiles, filtered, interpolated, …)

  • subtile_id – str or int representing the id of the subtile

  • extension – str representing file extension (.las, .tif)

Returns

string containing full path of subtile

get_tile_name()
get_tile_type()
get_top()

Returns tile to the top of this tile :return: List with tile filepath, or empty list if no adjacent exists

get_top_left()

Gets all known filepaths for tiles in the left top. So: left, left-top, and top as these are all needed to get overlap for this corner.

Returns

List of all tile filepaths, or empty list if no adjacent exists

get_top_right()

Gets all known filepaths for tiles in the right top. So: right, right-top, and top as these are all needed to get overlap for this corner.

Returns

List of all tile filepaths, or empty list if no adjacent exists

get_unbuffered_geometry()
open()
class src.tile.TileTypes

Bases: object

MAIN = 'main'
SUBTILE = 'subtile'

Module contents