github sshuair/cogeotiff v0.1
create and validate cog file for both Python API or command line

5 years ago

Python PAI

  1. create cog file
    example:
from cogeotiff.cog import create_cog
src_path = '~/path_to_image/test.tif'
dest_path = '~/path_to_save/test.tiff.cog'
create_cog(src_path, dest_path, compress='jpeg')
  1. validate cog file
from cogeotiff.validate_cogeotiff import validate_cog
cog_path = '~/path_to_cog.tif.cog'
result = validate_cog(cog_path)

Command tools

  1. create cog file
Usage: cog create [OPTIONS] SRC_PATH DST_PATH

Options:
  --overview-resampling TEXT  resampling method for create pyramiddefault:
                              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,default: raw
  --help                      Show this message and exit.
  1. validate cog file
Usage: cog create [OPTIONS] COG_PATH 

Don't miss a new cogeotiff release

NewReleases is sending notifications on new releases.