mapreader.load.loader

Module Contents

Functions

loader([path_images, tree_level, parent_path])

Creates a MapImages class to manage a collection of image paths and

load_patches(patch_paths[, patch_file_ext, ...])

Creates a MapImages class to manage a collection of image paths and

mapreader.load.loader.loader(path_images=None, tree_level='parent', parent_path=None, **kwargs)

Creates a MapImages class to manage a collection of image paths and construct image objects.

Parameters:
  • path_images (str or None, optional) – Path to the directory containing images (accepts wildcards). By default, None

  • tree_level (str, optional) – Level of the image hierarchy to construct. The value can be "parent" (default) and "patch".

  • parent_path (str, optional) – Path to parent images (if applicable), by default None.

  • **kwargs (dict, optional) – Additional keyword arguments to be passed to the _images_constructor() method.

Returns:

The MapImages class which can manage a collection of image paths and construct image objects.

Return type:

MapImages

Notes

This is a wrapper method. See the documentation of the mapreader.load.images.MapImages class for more detail.

mapreader.load.loader.load_patches(patch_paths, patch_file_ext=False, parent_paths=False, parent_file_ext=False, add_geo_info=False, clear_images=False)

Creates a MapImages class to manage a collection of image paths and construct image objects. Then loads patch images from the given paths and adds them to the images dictionary in the MapImages instance.

Parameters:
  • patch_paths (str) –

    The file path of the patches to be loaded.

    Note: The ``patch_paths`` parameter accepts wildcards.

  • patch_file_ext (str or bool, optional) – The file extension of the patches, ignored if file extensions are specified in patch_paths (e.g. with "./path/to/dir/*png") By default False.

  • parent_paths (str or bool, optional) –

    The file path of the parent images to be loaded. If set to False, no parents are loaded. Default is False.

    Note: The ``parent_paths`` parameter accepts wildcards.

  • parent_file_ext (str or bool, optional) – The file extension of the parent images, ignored if file extensions are specified in parent_paths (e.g. with "./path/to/dir/*png") By default False.

  • add_geo_info (bool, optional) – If True, adds geographic information to the parent image. Default is False.

  • clear_images (bool, optional) – If True, clears the images from the images dictionary before loading. Default is False.

Returns:

The MapImages class which can manage a collection of image paths and construct image objects.

Return type:

MapImages

Notes

This is a wrapper method. See the documentation of the mapreader.load.images.MapImages class for more detail.

This function in particular, also calls the mapreader.load.images.MapImages.loadPatches() method. Please see the documentation for that method for more information as well.