ocssw
V2022
|
cyan_conus_tiles.py File Reference
Go to the source code of this file.
Namespaces | |
cyan_conus_tiles | |
Variables | |
parser | |
action | |
version | |
help | |
args = parser.parse_args() | |
int | nXtiles = 9 |
int | nYtiles = 6 |
sourcefile = args.ifile | |
sourcefilebase = sourcefile.rstrip('.tif') | |
srcDS = gdal.Open(sourcefile) | |
T0 = Affine.from_gdal(*srcDS.GetGeoTransform()) | |
xy2rc = lambda xm, ym: (ym, xm) * ~T0 | |
xoff = int(xoff) | |
yoff = int(yoff) | |
endx = int(endx) | |
endy = int(endy) | |
xstride = int((endx-xoff)/nXtiles) | |
ystride = int((endy-yoff)/nYtiles) | |
int | ytile = y + 1 |
uly = y * ystride + yoff | |
int | xtile = x +1 |
ulx = x * xstride + xoff | |
list | srcwin = [ulx,uly,xstride,ystride] |
string | tileFile = sourcefilebase + '_' + str(xtile) + '_' + str(ytile) + '.tif' |
transop = gdal.TranslateOptions(creationOptions=['COMPRESS=LZW'],srcWin=srcwin) | |
options | |