Public Member Functions | |
def | __init__ (self, logger, inFileDicts, tilingStr, namingStr, tempdir, distribute=0, buffer=0, aoi=None, resultFileNames=None, skipIfExists=0, shapefileExport=False, do_cut=True) |
Instantiates a tileManager-Object. More... | |
def | save_as_textfile (self, outpath) |
to be implemented :param outpath: :return: None More... | |
def | load_from_textfile (self, inpath) |
to be implemented :param inpath: :return: None More... | |
def | parseNamingString (self) |
Parses the naming :return: None . More... | |
def | parseTilingString (self) |
Tries to grasp the tiling concept. More... | |
def | tile (self) |
Creates the tiling concept based on the input parameters to the init method. More... | |
def | cut (self, do_cut) |
def | __iter__ (self) |
def | __len__ (self) |
def | __next__ (self) |
Method for getting a dict of files for the next tile. More... | |
def | next (self) |
def | tileCount (self) |
def | cutToNetSize (self, nexttileDict, rasterfiles=list(), vectorfiles=list(), overwrite=True) |
Cuts all input Files (odm or raster) to the net size by exporting with filter of unbuffered poly Will create temporary files, but will delete them afterwards. More... | |
def | printStatistics (self) |
Prints statistics after processing. More... | |
def __init__ | ( | self, | |
logger, | |||
inFileDicts, | |||
tilingStr, | |||
namingStr, | |||
tempdir, | |||
distribute = 0 , |
|||
buffer = 0 , |
|||
aoi = None , |
|||
resultFileNames = None , |
|||
skipIfExists = 0 , |
|||
shapefileExport = False , |
|||
do_cut = True |
|||
) |
Instantiates a tileManager-Object.
:param inFileDicts: List of dictionaries containing information about input files. Has to look like:
inFileDicts = [{'files': [r'DSM\1.odm',
r'DSM\2.odm',
r'DSM\3.odm',
r'DSM\4.odm'], # List of Files (relative or full path, no */?)
'type': 'odm', # either odm or raster
'name': 'dsm', # any name that can be used as a dict key and a (windows) filename
'required': True},
{'files': [r'DTM\1.tif',
r'DTM\2.tif',
r'DTM\3.tif',
r'DTM\4.tif'],
'type': 'raster',
'name': 'dtm',
'required': False},
{'files': [r'1.odm'],
'type': 'odm',
'name': 'ndsm',
'required': False}]
:param tilingStr: a string for a tiling concept that can be processed with parseTilingString(), or None
:param tempdir: name of a temporary directory (will be created if not exists)
:param buffer: amount with which to buffer the individual tiles (meters, use 0 for no buffer)
:param aoi: area of interest to which tiling should be confined to
:return: None
References tileManager.aoi, tileManager.buffer, tileManager.completedTiles, tileManager.curTileId, tileManager.distribute, tileManager.do_cut, tileManager.failedTiles, tileManager.inFileDicts, tileManager.inRasterFiles, tileManager.inVectorFiles, local.logger, Dispatcher.logger, tileManager.logger, distributedBase.logger, tileManager.namingStr, tileManager.overallBBox, tileManager.parseNamingString(), tileManager.parseTilingString(), tileManager.requiredBBox, tileManager.resultFileNames, tileManager.shapefile_export, tileManager.skipIfExists, tileManager.skippedTiles, tileManager.tempdir, tileManager.tiles, and tileManager.tilingStr.
def __next__ | ( | self | ) |
Method for getting a dict of files for the next tile.
The dict will look like this:
{'tile_id': Integer (list index) to represent a tile number
'sample1': (relative) Path to input tile of class 'sample1', e.g. 'path/to/sample1.tif'
'sample2': (relative) Path to input tile of class 'sample2', e.g. 'path/to/sample2.odm'
[...]
'type': 'bbox' or 'poly'
'bbox': rasterfun.bbox() covering the tile
'buffered_region_filter': Filter String containing region vertices, with buffer
'region_filter': See above, without buffer
[optional] 'buffered_shapefile_name': path to a shapefile containing single polygon of buffered tile
[optional] 'shapefile_name': path to a shapefile containing single polygon of unbuffered tile (for cutting)
'tile_name': Suffix/Partial Name that should be used for naming of output files
}
:return: tiledict of the next tile
References tileManager.__next__(), tileManager.curTileId, local.logger, Dispatcher.logger, tileManager.logger, distributedBase.logger, tileManager.next(), Import.next(), tileManager.resultFileNames, tileManager.shapefile_export, tileManager.skipIfExists, tileManager.skippedTiles, tileManager.tempdir, tileManager.TiledFiles, and tileManager.tiles.
Referenced by tileManager.__next__().
def cutToNetSize | ( | self, | |
nexttileDict, | |||
rasterfiles = list() , |
|||
vectorfiles = list() , |
|||
overwrite = True |
|||
) |
Cuts all input Files (odm or raster) to the net size by exporting with filter of unbuffered poly
Will create temporary files, but will delete them afterwards.
In case of axes-parallel rectangle tiling, uses limit instead of filter.
Relies on gdal_rasterize as of 2016-03-24, since opalsRasterize seems to have issues.
:param: nexttileDict
:param: rasterfiles
:param: vectorfiles
:return: Nothing.
References tileManager.tempdir.
def load_from_textfile | ( | self, | |
inpath | |||
) |
to be implemented
:param inpath:
:return: None
def parseNamingString | ( | self | ) |
Parses the naming
:return: None
.
References tileManager.namingConcept, tileManager.namingCorner, tileManager.namingDelimiter, tileManager.namingnDigits, tileManager.namingStr, and tileManager.tilingConcept.
Referenced by tileManager.__init__().
def parseTilingString | ( | self | ) |
Tries to grasp the tiling concept.
Possibilities:
References tileManager.inRasterFiles, tileManager.inVectorFiles, tileManager.tileCols, tileManager.tileFile, tileManager.tileRows, IndexDescription.tileSize, tileManager.tileSize, tileManager.tilingConcept, and tileManager.tilingStr.
Referenced by tileManager.__init__().
def printStatistics | ( | self | ) |
Prints statistics after processing.
:param tiles_completed: count of tiles that were processed normally
:param tiles_skipped: count of tiles that were skipped (e.g. emtpy tile)
:param tiles_failed: count of tiles that failed (with errors)
:return: prints statistic information
References tileManager.completedTiles, tileManager.failedTiles, local.logger, Dispatcher.logger, tileManager.logger, distributedBase.logger, tileManager.skippedTiles, and tileManager.tileCount().
def save_as_textfile | ( | self, | |
outpath | |||
) |
to be implemented
:param outpath:
:return: None
def tile | ( | self | ) |
Creates the tiling concept based on the input parameters to the init method.
Run this after instantiating the class, and parsing naming and tiling strings, but before grabbing the first tile.
:return: Nothing.
References tileManager.buffer, tileManager.curTileId, tileManager.cut(), tileManager.distribute, tileManager.do_cut, tileManager.inFileDicts, tileManager.inRasterFiles, tileManager.inVectorFiles, local.logger, Dispatcher.logger, tileManager.logger, distributedBase.logger, tileManager.namingConcept, tileManager.namingCorner, tileManager.namingDelimiter, tileManager.namingnDigits, tileManager.namingStr, tileManager.requiredBBox, tileManager.tempdir, tileManager.tile(), tileManager.tileCols, tileManager.TiledFiles, tileManager.tileFile, tileManager.tileRows, tileManager.tiles, IndexDescription.tileSize, tileManager.tileSize, tileManager.tilingConcept, and tileManager.tilingStr.
Referenced by tileManager.tile().