Tiling
- class eolab.georastertools.Tiling(geometry_file: str)[source]
Bases:
RastertoolRaster tool that tiles a raster following the geometries of a grid.
The tool takes as input two files: a raster image and a grid file (shapefile, geojson …). The grid file defines the geometries of the tiles.
Different options can be configured:
output dir: select the dir where tiles will be stored to disk
output basename: naming rule of tiles. By default, the basename is the name of the original file followed by “_tile” followed by the tile index. In the formatted string, tile index is at position 1 and original filename is at position 0. For instance, a naming rule such as “tile{1}.tif” will generate the tile name “tile75.tif” for the tile id = 75.
output subdir: naming rule for subdirs when every tile must be generated in a different subdir.
It is also possible to select the tiles to generate. The seleted tiles are the ones which match the expected values of a given grid’s property.
Attributes
Get the grid that defines the geometries for tiling raster images
Whether intermediate VRT images shall be kept
Base name for naming output
Naming convention of the subdir where to store outputs.
Path of the output directory where are stored the results
Dir where to store intermediate VRT images
Methods
Tiling.__init__(geometry_file)Constructor
Tiling.postprocess_files(inputfiles, outputfiles)Run a postprocess when all input files have been processed.
Tiling.process_file(inputfile)Tile the input file following the geometry file
Tiling.process_files(inputfiles)Run the rastertool to a set of input files.
Tiling.with_id_column(id_column, ids)Set up a filter on the geometries for which tiles shall be generated.
Tiling.with_output([outputdir, ...])Set up the output.
Tiling.with_vrt_stored(keep_vrt)Configure if the intermediate VRT images that are generated when handling the input files (which can be complex raster product composed of several band files) shall be stored to disk or not - for debug purpose for instance.