gemgis.raster.create_filepaths
gemgis.raster.create_filepaths#
- gemgis.raster.create_filepaths(dirpath: str, search_criteria: str, create_directory: bool = False) List[str] #
Retrieving the file paths of the tiles to load and to process them later
- Parameters
dirpath (str) – Path to the folder where tiles are stored, e.g.
dirpath='Documents/images/'
search_criteria (str) – Name of the files including file ending, use
*
for autocompletion by Python, e.g.search_criteria='tile*.tif'
create_directory (bool) – Variable to create a new directory if directory does not exist Options include:
True
orFalse
, default set toFalse
- Returns
filepaths – List of file paths
- Return type
List[str]
New in version 1.0.x.
Example
>>> # Loading Libraries >>> import gemgis as gg
>>> # Defining filepath >>> filepath = 'Documents/images/'
>>> # Creating list of filepaths based on search criteria >>> filepaths = gg.raster.create_filepaths(dirpath=filepath, search_criteria='tile*.tif') >>> filepaths ['Documents/images//tile_292000_294000_5626000_5628000.tif', 'Documents/images//tile_292000_294000_5628000_5630000.tif', 'Documents/images//tile_292000_294000_5630000_5632000.tif', 'Documents/images//tile_294000_296000_5626000_5628000.tif']