from cogeotiff.validate_cogeotiff import validate_cog
cog_path ='~/path_to_cog.tif.cog'
result = validate_cog(cog_path)
Command tools
create cog file
Usage: cog create [OPTIONS] SRC_PATH DST_PATH
Options:
--overview-resampling TEXT resampling method for create pyramid default:
nearest
--overview-level INTEGER levels to build
--nodata INTEGER Assign a specified nodata value to output bands.
default: 0
--block-size INTEGER tiled size, default: 512
--compress TEXT compress method: JPEG,RAW,DEFLATE,LZW,WEBP,ZSTD,PACKBITS,default: raw
--help Show this message and exit.
validate cog file
Usage: cog create [OPTIONS] COG_PATH
Q&A
Q: why not use GDAL BuildOverviews or Rasterio in script?
A: Because for large file such as 100GB, it's take long time to generate overview and translate to tiled GeoTiff. There is no progress infomataion use Rasterio or GDAL BuildOverviews methods.
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.