Utils#
- detectree.split_into_tiles(input_filepath, output_dir, *, tile_width=None, tile_height=None, output_filename=None, only_full_tiles=False, keep_empty_tiles=False, custom_meta=None)[source]#
Split the image of input_filepath into tiles.
- Parameters:
input_filepath (str, file object or pathlib.Path object) – Path to a file, URI, file object opened in binary (‘rb’) mode, or a Path object representing the image to be classified. The value will be passed to rasterio.open
output_dir (str or pathlib.Path object) – Path to the directory where the predicted images are to be dumped.
tile_width (int, optional) – Tile width in pixels. If no value is provided, the value set in settings.TILE_WIDTH is used.
tile_height (int, optional) – Tile height in pixels. If no value is provided, the value set in settings.TILE_HEIGHT is used.
output_filename (str, optional) – Template to be string-formatted in order to name the output tiles. If no value is provided, the value set in settings.TILE_OUTPUT_FILENAME is used.
only_full_tiles (bool, optional (default False)) – Whether only full tiles (of size tile_width`x`tile_height) should be dumped.
keep_empty_tiles (bool, optional (default False)) – Whether tiles containing only no-data pixels should be dumped.
custom_meta (dict, optional) – Custom meta data for the output tiles.
- Returns:
output_filepaths – List of the file paths of the dumped tiles.
- Return type:
list