titan.rio_utils¶
Utility functions to make it easier to work with rasterio
in python.
block_windows(width, height, blockxsize=BLOCKSIZE, blockysize=BLOCKSIZE)
¶
Returns a tuple of iterables with custom window sizes for block-based read/write.
Designed to be used as a custom block size implementation of rasterio's src.block_windows()
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
width |
int
|
the raster width (xsize) in pixels. |
required |
height |
int
|
the raster height (ysize) in pixels. |
required |
blockxsize |
int
|
the size of the x (column) dimension to read per block. |
BLOCKSIZE
|
blockysize |
int
|
the size of the y (row) dimension to read per block. |
BLOCKSIZE
|
Returns:
Name | Type | Description |
---|---|---|
iter |
idxs, windows
|
an iterable with a tuple of block indexes ((0, 0), (0, 1) ... ) and Windows (Window(col_off=0, row_off=0, width=blockxsize, height=blockysize), ... ). |
Source code in titan/rio_utils.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|