This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Kindle Clippings to zk Note Importer | |
| DISCLAIMER | |
| ---------- | |
| Claude did most of the work here. It seems to work well for me but YMMV. | |
| Use at your own risk...and back up your files. I assume no responsibility | |
| for the outcome of this script. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from osgeo import gdal | |
| in_img = 'input.tif' | |
| dst_img = 'output.tif' | |
| gdal.Translate(dst_img, in_img, options=gdal.TranslateOptions(bandList=[1, 2, 3])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import rasterio as rio | |
| from rasterio import windows | |
| def get_intersect(rasters): | |
| """ | |
| Computes intersect of input rasters. | |
| :param rasters: iterable of rasters to compute intersect | |
| :return: tuple of intersect (left, bottom, right, top) |